Skip to content

Commit 7c1a58c

Browse files
committed
ci: auto-publish Docker image to ghcr.io
1 parent fc09e76 commit 7c1a58c

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: docker/login-action@v3
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- uses: docker/metadata-action@v5
29+
id: meta
30+
with:
31+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
32+
tags: |
33+
type=raw,value=latest
34+
type=sha,prefix=
35+
36+
- uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
target: runtime
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
build-args: |
44+
UPDATE_LEGALITY=true
45+
PKHEX_TAG=26.05.05

0 commit comments

Comments
 (0)