Update actions/checkout action to v5.0.1 (#19) #15
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 Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Docker Image | |
| strategy: | |
| matrix: | |
| include: | |
| - key: linux-amd64 | |
| os: ubuntu-latest | |
| platform: linux/amd64 | |
| - key: linux-arm64 | |
| os: ubuntu-24.04-arm | |
| platform: linux/arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: walnuts1018 | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| with: | |
| version: latest | |
| - name: Build and push Docker images | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| id: build | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| outputs: type=image,name=ghcr.io/walnuts1018/ipxe-manager,push-by-digest=true,name-canonical=true,push=true | |
| cache-from: type=gha,scope=${{ matrix.key }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.key }} | |
| - 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: digests-${{ matrix.key }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| path: /tmp/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Login to ghcr.io | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
| with: | |
| registry: ghcr.io | |
| username: walnuts1018 | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set Image Tag | |
| run: echo "ImageTag=0.0.${{ github.run_number }}" >> $GITHUB_ENV | |
| - name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/walnuts1018/ipxe-manager:latest \ | |
| -t ghcr.io/walnuts1018/ipxe-manager:${{ env.ImageTag }} \ | |
| $(printf 'ghcr.io/walnuts1018/ipxe-manager@sha256:%s ' *) |