From f8814caedd18eb959160cd66b57ba05e6554b91b Mon Sep 17 00:00:00 2001 From: piotrekkr Date: Sat, 24 Feb 2024 17:56:49 +0100 Subject: [PATCH] Build images for multiple platforms (amd64/arm64) --- .github/workflows/release.yaml | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 23dd58f..006f898 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,27 +20,6 @@ jobs: name: Build And Release runs-on: ubuntu-22.04 steps: - - name: Cleanup untagged images - env: - GH_TOKEN: ${{ github.token }} - run: | - name=salesforce-archivist - to_delete=$( - gh api "/user/packages/container/${name}/versions" \ - --jq '.[] | select(.metadata.container.tags==[]) | .id' - ) - if [[ -z $to_delete ]]; then - echo "No untagged images found" - exit 0 - fi - - while read -r id; do - echo "Deleting untagged image id: ${id}" - gh api -X DELETE "/user/packages/container/${name}/versions/${id}"; - done <<< "$to_delete" - - exit 1 - - name: Calculate params id: params run: | @@ -90,9 +69,20 @@ jobs: cache-to: type=gha,mode=max,scope=archivist - name: Cleanup untagged images + env: + GH_TOKEN: ${{ github.token }} run: | name=salesforce-archivist + to_delete=$( + gh api "/user/packages/container/${name}/versions" \ + --jq '.[] | select(.metadata.container.tags==[]) | .id' + ) + if [[ -z $to_delete ]]; then + echo "No untagged images found" + exit 0 + fi + while read -r id; do echo "Deleting untagged image id: ${id}" gh api -X DELETE "/user/packages/container/${name}/versions/${id}"; - done <<< "$(gh api "/user/packages/container/${name}/versions" --jq '.[] | select(.metadata.container.tags==[]) | .id')" + done <<< "$to_delete"