Skip to content

Commit bead157

Browse files
committed
SWPROT-8953: ci: github: Upload artifacts
Build all branches Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent 4d9254f commit bead157

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
name: Docker Image CI
1+
# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*-
2+
---
23

3-
on:
4+
name: Build in docker
5+
6+
on: # yamllint disable-line rule:truthy
47
push:
5-
branches: [ '*' ]
6-
pull_request:
7-
branches: [ '*' ]
88

99
jobs:
1010
build:
11+
env:
12+
project-name: unifysdk
1113
runs-on: ubuntu-22.04
1214
steps:
13-
- uses: actions/checkout@v4.1.1
14-
with:
15-
fetch-depth: 0
16-
- name: Build Docker image from sources
17-
run: docker build .
15+
- uses: actions/checkout@v4.1.1
16+
with:
17+
fetch-depth: 0
18+
- id: describe
19+
name: Describe HEAD
20+
run: |
21+
echo "describe=$(git describe --tags --always || echo 0)" | tee $GITHUB_OUTPUT
22+
- name: Build Docker image from sources
23+
run: docker build --tag "${{ env.project-name }}:latest" .
24+
- name: Extract artifacts
25+
run: |
26+
container=$(docker create "${{ env.project-name }}:latest")
27+
docker cp ${container}:/usr/local/opt/${{ env.project-name }}/build/dist .
28+
- name: Upload artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}
32+
path: dist/
33+

0 commit comments

Comments
 (0)