Skip to content

Commit

Permalink
create separat amd/arm steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKniep committed Jan 25, 2023
1 parent 62654cb commit 6c101fc
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build-publish-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
run: |
echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo IMAGE_TAG=$(date +"%F")-${{ github.run_id }}.${{ github.run_number }} >> $GITHUB_ENV
- name: Build and push to GitHub Packages
uses: docker/build-push-action@v3
with:
Expand All @@ -72,8 +71,29 @@ jobs:
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Build and push to amd64
uses: docker/build-push-action@v3
with:
tags: |
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64:latest
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-amd64:${{ env.IMAGE_TAG }}
context: ${{ matrix.tag }}
platforms: linux/amd64
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
cache-from: type=local,src=/tmp/.buildx-cache
- name: Build and push to arm64
uses: docker/build-push-action@v3
with:
tags: |
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64:latest
ghcr.io/${{ env.REPOSITORY_OWNER }}/${{ matrix.tag }}-arm64:${{ env.IMAGE_TAG }}
context: ${{ matrix.tag }}
platforms: linux/arm64
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
cache-from: type=local,src=/tmp/.buildx-cache


0 comments on commit 6c101fc

Please sign in to comment.