Split multi-arch build across dedicated runners
Some checks failed
Build and Push Docker Image / check-version (push) Has been cancelled
Build and Push Docker Image / build (linux/amd64, linux-amd64) (push) Has been cancelled
Build and Push Docker Image / build (linux/arm64, linux-arm64) (push) Has been cancelled
Build and Push Docker Image / merge (push) Has been cancelled
Some checks failed
Build and Push Docker Image / check-version (push) Has been cancelled
Build and Push Docker Image / build (linux/amd64, linux-amd64) (push) Has been cancelled
Build and Push Docker Image / build (linux/arm64, linux-arm64) (push) Has been cancelled
Build and Push Docker Image / merge (push) Has been cancelled
- ARM64 builds run on Raspberry Pi (linux-arm64 runner) - AMD64 builds run on laptop (linux-amd64 runner) - Builds run in parallel on separate machines - Manifest merge creates final multi-arch image 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,14 @@ jobs:
|
||||
build:
|
||||
needs: check-version
|
||||
if: needs.check-version.outputs.should_build == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
runner: linux-amd64
|
||||
- platform: linux/arm64
|
||||
runner: linux-arm64
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -58,17 +65,58 @@ jobs:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
git.nicola.sh/public/nicotine-less:latest
|
||||
git.nicola.sh/public/nicotine-less:${{ needs.check-version.outputs.latest_version }}
|
||||
cache-from: type=registry,ref=git.nicola.sh/public/nicotine-less:buildcache
|
||||
cache-to: type=registry,ref=git.nicola.sh/public/nicotine-less:buildcache,mode=max
|
||||
platforms: ${{ matrix.platform }}
|
||||
outputs: type=image,name=git.nicola.sh/public/nicotine-less,push-by-digest=true,name-canonical=true,push=true
|
||||
cache-from: type=registry,ref=git.nicola.sh/public/nicotine-less:buildcache-${{ matrix.platform }}
|
||||
cache-to: type=registry,ref=git.nicola.sh/public/nicotine-less:buildcache-${{ matrix.platform }},mode=max
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-${{ matrix.platform }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
merge:
|
||||
needs: build
|
||||
runs-on: linux-amd64
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.nicola.sh
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
-t git.nicola.sh/public/nicotine-less:latest \
|
||||
-t git.nicola.sh/public/nicotine-less:${{ needs.check-version.outputs.latest_version }} \
|
||||
$(printf 'git.nicola.sh/public/nicotine-less@sha256:%s ' *)
|
||||
|
||||
- name: Create release
|
||||
if: needs.check-version.outputs.should_build == 'true'
|
||||
|
||||
Reference in New Issue
Block a user