Skip to content

Commit a5c633d

Browse files
committed
Add docker.yml Actions workflow to build and deploy a Docker image
1 parent 562c614 commit a5c633d

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
13+
jobs:
14+
docker:
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
- name: Login to Docker Hub
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Extract metadata (tags, labels) for Docker
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
- name: Build and push
38+
uses: docker/build-push-action@v5
39+
with:
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
file: pkg/docker/Dockerfile
44+

0 commit comments

Comments
 (0)