Skip to content

Commit 10e0879

Browse files
committed
add workflow
1 parent 091392e commit 10e0879

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/build-docker.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 }}

0 commit comments

Comments
 (0)