Skip to content

Commit 53e99ef

Browse files
mattnfiatjaf
authored andcommitted
GitHub workflows for docker image
1 parent 8b038d7 commit 53e99ef

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: publish docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
push_to_registry:
10+
name: Docker
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repo
14+
uses: actions/checkout@v3
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v1
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v1
22+
23+
- name: Log in to GitHub Container Registry
24+
uses: docker/login-action@v2
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@v3
33+
with:
34+
images: ghcr.io/${{ github.repository }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v2
38+
with:
39+
context: .
40+
platforms: linux/amd64
41+
builder: ${{ steps.buildx.outputs.name }}
42+
push: ${{ github.event_name != 'pull_request' }}
43+
tags: |
44+
ghcr.io/${{ github.repository }}:latest
45+
${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)