From 7f274980b51001a84041d80149a0da9952c3c286 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 17 Aug 2024 22:51:33 -0700 Subject: [PATCH] Update workflow --- .github/workflows/pr-release.yml | 47 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pr-release.yml b/.github/workflows/pr-release.yml index c21de15..ca56b6c 100644 --- a/.github/workflows/pr-release.yml +++ b/.github/workflows/pr-release.yml @@ -18,6 +18,16 @@ jobs: attestations: write id-token: write steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Buildx + uses: docker/setup-buildx-action@v1 + - name: Download images uses: actions/download-artifact@v4 with: @@ -27,15 +37,30 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GH_PAT }} - - name: Set up Buildx - uses: docker/setup-buildx-action@v1 - - name: Load image shell: bash run: | docker load -i /tmp/images/image-linux-amd64.tar docker load -i /tmp/images/image-linux-arm64.tar + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GH_PAT }} + + - name: Push images + working-directory: /tmp/digests + run: | + for file in ./*; do + hash=$(basename "$file") + + docker push "sha256:$hash" + done + - name: Download Docker metadata uses: actions/download-artifact@v4 with: @@ -64,22 +89,6 @@ jobs: with: path: /tmp/pull_request_number/pull_request_number/pull_request_number.txt - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GH_PAT }} - - name: Create manifest list and push working-directory: /tmp/digests run: |