-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (37 loc) · 1.3 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*-
---
name: z-wave-protocol-controller Build in docker
on: # yamllint disable-line rule:truthy
push:
jobs:
build:
env:
project-name: z-wave-protocol-controller # This should be lowercase for docker (and aligned)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- id: describe
name: Describe HEAD
run: >-
echo "describe=$(git describe --tags --always || echo 0)"
| tee $GITHUB_OUTPUT
- name: Build Docker image from sources
run: >-
docker build
--tag "${{ env.project-name }}:latest"
--build-arg UNIFYSDK_GIT_REPOSITORY=${{ secrets.UNIFYSDK_GIT_REPOSITORY }}
--build-arg UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }}
.
- name: Extract artifacts
run: >-
container=$(docker create "${{ env.project-name }}:latest")
&& docker cp
${container}:/usr/local/opt/${{ env.project-name }}/build/dist .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
# yamllint disable-line
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}
path: dist/