Skip to content

Commit 35b34b7

Browse files
author
DatanoiseTV
committed
ci: publish multi-arch Docker image to GHCR on release
- build linux/amd64 + linux/arm64 via buildx - tags: semver, major.minor, major, :beta (for -beta.* tags), :latest (for stable) - gated on test_startup; uses GITHUB_TOKEN with packages: write - README: point Docker quick-start at ghcr.io/datanoisetv/tinyice
1 parent d0bb212 commit 35b34b7

2 files changed

Lines changed: 303 additions & 317 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
packages: write
1011

1112
jobs:
1213
build:
@@ -139,4 +140,52 @@ jobs:
139140
artifacts/**/tinyice*
140141
checksums.txt
141142
env:
142-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
145+
docker:
146+
name: Build and Push Docker Image
147+
needs: test_startup
148+
runs-on: ubuntu-latest
149+
if: startsWith(github.ref, 'refs/tags/')
150+
steps:
151+
- name: Checkout code
152+
uses: actions/checkout@v4
153+
154+
- name: Set up QEMU
155+
uses: docker/setup-qemu-action@v3
156+
157+
- name: Set up Docker Buildx
158+
uses: docker/setup-buildx-action@v3
159+
160+
- name: Log in to GHCR
161+
uses: docker/login-action@v3
162+
with:
163+
registry: ghcr.io
164+
username: ${{ github.actor }}
165+
password: ${{ secrets.GITHUB_TOKEN }}
166+
167+
- name: Extract metadata
168+
id: meta
169+
uses: docker/metadata-action@v5
170+
with:
171+
images: ghcr.io/${{ github.repository_owner }}/tinyice
172+
tags: |
173+
type=semver,pattern={{version}}
174+
type=semver,pattern={{major}}.{{minor}}
175+
type=semver,pattern={{major}}
176+
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
177+
type=raw,value=beta,enable=${{ contains(github.ref_name, '-beta') }}
178+
179+
- name: Build and push
180+
uses: docker/build-push-action@v6
181+
with:
182+
context: .
183+
platforms: linux/amd64,linux/arm64
184+
push: true
185+
tags: ${{ steps.meta.outputs.tags }}
186+
labels: ${{ steps.meta.outputs.labels }}
187+
build-args: |
188+
VERSION=${{ github.ref_name }}
189+
COMMIT=${{ github.sha }}
190+
cache-from: type=gha
191+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)