🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
ci: fix broken amd64 images build, use QEMU for multi-arch build (#165)
Andrii Andrushchyshynb632eef78036
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.ymlindex 9155ba779..5806ad31b 100644--- a/.github/workflows/docker-publish.yml+++ b/.github/workflows/docker-publish.yml@@ -6,17 +6,7 @@ on:jobs:build-and-push:-- strategy:- matrix:- include:- - platform: linux/amd64- runner: ubuntu-22.04- - platform: linux/arm64- runner: ubuntu-22.04-arm-- runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}-+ runs-on: ubuntu-latestpermissions:contents: readpackages: write@@ -25,8 +15,15 @@ jobs:- name: Checkout repositoryuses: actions/checkout@v4+ # 1) Register QEMU emulators for cross-platform builds+ - name: Set up QEMU+ uses: docker/setup-qemu-action@v2++ # 2) Create and use a Docker Buildx builder instance- name: Set up Docker Buildxuses: docker/setup-buildx-action@v3+ with:+ buildkitd-flags: --debug- name: Log in to GitHub Container Registryuses: docker/login-action@v3@@ -39,24 +36,22 @@ jobs:id: meta_backenduses: docker/metadata-action@v5with:- # Images will be ghcr.io/rybbit-io/rybbit-backendimages: ghcr.io/${{ github.repository_owner }}/rybbit-backendtags: |- type=ref,event=branch # Creates tag like :master- type=sha # Creates tag like :<commit_sha_short>- # Tags 'master' branch pushes additionally with 'latest'- type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}+ type=ref,event=branch+ type=sha+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}- - name: Build and push Backend Docker image+ - name: Build and push Backend Docker image (multi-arch)uses: docker/build-push-action@v6with:- context: ./server #+ context: ./serverfile: ./server/Dockerfilepush: true- platforms: ${{ matrix.platform }} # linux/amd64 or linux/arm64+ platforms: linux/amd64,linux/arm64tags: ${{ steps.meta_backend.outputs.tags }}labels: ${{ steps.meta_backend.outputs.labels }}- # # Optional: Enable build cache for potentially faster builds+ # Optional: enable build cache for speed# cache-from: type=gha,scope=${{ github.workflow }}-backend# cache-to: type=gha,scope=${{ github.workflow }}-backend,mode=max@@ -64,23 +59,21 @@ jobs:id: meta_clientuses: docker/metadata-action@v5with:- # Images will be ghcr.io/rybbit-io/rybbit-clientimages: ghcr.io/${{ github.repository_owner }}/rybbit-clienttags: |type=ref,event=branchtype=sha- # Tags 'master' branch pushes additionally with 'latest'- type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}- - name: Build and push Client Docker image+ - name: Build and push Client Docker image (multi-arch)uses: docker/build-push-action@v6with:context: ./clientfile: ./client/Dockerfilepush: true- platforms: ${{ matrix.platform }} # linux/amd64 or linux/arm64+ platforms: linux/amd64,linux/arm64tags: ${{ steps.meta_client.outputs.tags }}labels: ${{ steps.meta_client.outputs.labels }}- # # Optional: Enable build cache for potentially faster builds+ # Optional: enable build cache for speed# cache-from: type=gha,scope=${{ github.workflow }}-client- # cache-to: type=gha,scope=${{ github.workflow }}-client,mode=max+ # cache-to: type=gha,scope=${{ github.workflow }}-client,mode=max\ No newline at end of file