File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Build Docker image and publish to GHCR.
2
+ name : build-docker
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ pull_request :
7
+ paths :
8
+ - ' Dockerfile'
9
+ workflow_dispatch :
10
+ release :
11
+ types : [published]
12
+ env :
13
+ REGISTRY : ghcr.io
14
+ IMAGE_NAME : kuleuven-micas/snax
15
+ jobs :
16
+ build-docker :
17
+ name : Deploy Docker image
18
+ runs-on : ubuntu-24.04
19
+ steps :
20
+ - uses : actions/checkout@v2
21
+ - uses : docker/setup-buildx-action@v3
22
+ - name : GHCR Log-in
23
+ uses : docker/login-action@v3
24
+ with :
25
+ registry : ghcr.io
26
+ username : ${{ github.actor }}
27
+ password : ${{ secrets.GITHUB_TOKEN }}
28
+ - name : Extract metadata (tags, labels) for Docker
29
+ id : meta
30
+ uses : docker/metadata-action@v5
31
+ with :
32
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33
+ - name : Build and push
34
+ uses : docker/build-push-action@v2
35
+ with :
36
+ context : .
37
+ file : Dockerfile
38
+ push : true
39
+ labels : ${{ steps.meta.outputs.labels }}
40
+ tags : ${{ steps.meta.outputs.tags }}
You can’t perform that action at this time.
0 commit comments