Skip to content

Commit 7e168a0

Browse files
committed
ci: publish release images to GHCR on tags
Signed-off-by: Sinhala Gedera Malitha Ridhmal Rathnathilaka <malitha.uog04@edu.lnbti.lk>
1 parent d56a9c3 commit 7e168a0

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release image to GHCR
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to GHCR
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata (tags, labels)
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ghcr.io/${{ github.repository }}
37+
tags: |
38+
type=semver,pattern={{version}}
39+
type=raw,value=latest
40+
41+
- name: Build and push (multi-arch)
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: true
46+
platforms: linux/amd64,linux/arm64
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+

0 commit comments

Comments
 (0)