Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
types: [published]
workflow_dispatch:

concurrency:
group: api-${{ github.ref }}
cancel-in-progress: true

jobs:
docker:
name: Docker Build & Push
Expand All @@ -22,6 +26,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
Expand All @@ -43,10 +50,33 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: push
continue-on-error: true
uses: docker/build-push-action@v6
with:
context: ./src
file: ./src/Dockerfile-api
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max

# GHCR secondary rate limits ask callers to wait a few minutes and retry
- name: Wait out GHCR rate limit
if: steps.push.outcome == 'failure'
run: sleep 180

- name: Build and push (retry)
if: steps.push.outcome == 'failure'
uses: docker/build-push-action@v6
with:
context: ./src
file: ./src/Dockerfile-api
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max
Loading