Skip to content

Commit f83b843

Browse files
authored
Attempt #1 - GHA build & push image
1 parent e5226d6 commit f83b843

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and publish Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Docker meta
13+
id: meta
14+
uses: docker/metadata-action@v5
15+
with:
16+
# list of Docker images to use as base name for tags
17+
images: |
18+
${{ github.repository_owner }}/${{ github.repository_owner }}
19+
ghcr.io/${{ github.repository_owner }}/${{ github.repository_owner }}
20+
# generate Docker tags based on the following events/attributes
21+
tags: |
22+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
23+
type=semver,pattern={{major}}.{{minor}}
24+
type=semver,pattern={{major}}
25+
type=sha
26+
27+
- name: Login to GHCR
28+
if: github.event_name != 'pull_request'
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.repository_owner }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@v3
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@v6
43+
with:
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)