Skip to content

Commit 033ceca

Browse files
committed
create server container image on new tag creation
1 parent 6d837c5 commit 033ceca

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ jobs:
1212
build-client-webpack:
1313
uses: ./.github/workflows/client-webpack.yml
1414

15-
build-server-image:
16-
uses: ./.github/workflows/server-image.yml
17-
1815
release:
19-
needs: [build-client-webpack, build-server-image]
16+
needs: build-client-webpack
2017
runs-on: ubuntu-latest
2118

2219
steps:

.github/workflows/server-image.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Build and push back-end server Docker image
33
on:
44
workflow_call:
55
workflow_dispatch:
6+
# Run automatically when a new tag is created
7+
push:
8+
tags:
9+
- 'v0.*' # alpha
10+
- 'v1.*' # release
611

712
env:
813
REGISTRY: ghcr.io
@@ -47,9 +52,18 @@ jobs:
4752
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4853

4954
- name: Build and push container image
55+
id: push
5056
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # v3.0.0
5157
with:
5258
file: ./server/Dockerfile
5359
context: ./server
5460
push: true
55-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
64+
- name: Generate artifact attestation
65+
uses: actions/attest-build-provenance@v2
66+
with:
67+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
68+
subject-digest: ${{ steps.push.outputs.digest }}
69+
push-to-registry: true

0 commit comments

Comments
 (0)