fix: incomplete Blacksmith migration #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-amd64: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Blacksmith Builder | |
| uses: useblacksmith/setup-docker-builder@v1 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare repository name | |
| id: repo | |
| run: echo "name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| - name: Build and push (AMD64) | |
| uses: useblacksmith/build-push-action@v2 | |
| with: | |
| platforms: linux/amd64 | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ steps.repo.outputs.name }}:latest-amd | |
| ghcr.io/${{ steps.repo.outputs.name }}:${{ github.sha }}-amd | |
| build-arm64: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Blacksmith Builder | |
| uses: useblacksmith/setup-docker-builder@v1 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare repository name | |
| id: repo | |
| run: echo "name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| - name: Build and push (ARM64) | |
| uses: useblacksmith/build-push-action@v2 | |
| with: | |
| platforms: linux/arm64 | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ steps.repo.outputs.name }}:latest-arm | |
| ghcr.io/${{ steps.repo.outputs.name }}:${{ github.sha }}-arm | |
| build-merge: | |
| runs-on: blacksmith-4vcpu-ubuntu-2404 | |
| needs: | |
| - build-amd64 | |
| - build-arm64 | |
| steps: | |
| - name: Setup Blacksmith Builder | |
| uses: useblacksmith/setup-docker-builder@v1 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare repository name | |
| id: repo | |
| run: echo "name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| - name: Merge | |
| run: | | |
| docker buildx imagetools create -t ghcr.io/${{ steps.repo.outputs.name }}:latest \ | |
| ghcr.io/${{ steps.repo.outputs.name }}:latest-amd \ | |
| ghcr.io/${{ steps.repo.outputs.name }}:latest-arm |