fix(FileBlock): handle non-JSON error responses on file upload (#110) #13
Workflow file for this run
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: Docker Build (beta branches) | |
| on: | |
| push: | |
| branches: ["*-beta"] | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: docker-beta-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push linux/amd64 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 | |
| cache-from: type=gha,scope=linux-amd64-beta | |
| cache-to: type=gha,mode=max,scope=linux-amd64-beta | |
| build-arm64: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push linux/arm64 | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/arm64 | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64 | |
| cache-from: type=gha,scope=linux-arm64-beta | |
| cache-to: type=gha,mode=max,scope=linux-arm64-beta | |
| merge-manifest: | |
| needs: [build-amd64, build-arm64] | |
| if: needs.build-amd64.result == 'success' && needs.build-arm64.result == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| env: | |
| BETA_TAG: ${{ github.ref_name }} | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${BETA_TAG} \ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${BETA_TAG}-amd64 \ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${BETA_TAG}-arm64 | |
| - name: Delete intermediate arch-specific images | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO: ${{ github.repository }} | |
| BETA_TAG: ${{ github.ref_name }} | |
| run: | | |
| OWNER="${REPO%%/*}" | |
| PKG="${REPO##*/}" | |
| for SUFFIX in amd64 arm64; do | |
| TAG="${BETA_TAG}-${SUFFIX}" | |
| VERSION_ID=$(gh api "/users/${OWNER}/packages/container/${PKG}/versions" --paginate \ | |
| --jq ".[] | select(.metadata.container.tags[] == \"${TAG}\") | .id" | head -1) | |
| if [ -n "$VERSION_ID" ]; then | |
| gh api --method DELETE "/users/${OWNER}/packages/container/${PKG}/versions/${VERSION_ID}" | |
| echo "Deleted ${TAG} (version ${VERSION_ID})" | |
| else | |
| echo "Tag ${TAG} not found, skipping" | |
| fi | |
| done |