Something went wrong. Try again.
A lexicon-driven AppView for ATProto.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121name: Build and Publish Docker Image
on: release: types: [published]
env: GHCR_IMAGE: ghcr.io/${{ github.repository }} ATCR_IMAGE: atcr.io/${{ secrets.ATCR_NAMESPACE }}/happyview
jobs: happyview: if: startsWith(github.event.release.tag_name, 'v') permissions: contents: read packages: write id-token: write strategy: fail-fast: false matrix: include: - platform: linux/amd64 runs-on: depot-ubuntu-24.04 - platform: linux/arm64 runs-on: depot-ubuntu-24.04-arm runs-on: ${{ matrix.runs-on }}
steps: - name: Checkout repository uses: actions/checkout@v4
- name: Set up Docker Buildx uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }}
# TODO: Re-enable once ATCR rate limit issue is resolved # - name: Log in to ATCR # uses: docker/login-action@v3 # with: # registry: atcr.io # username: ${{ secrets.ATCR_USERNAME }} # password: ${{ secrets.ATCR_PASSWORD }}
- name: Extract GHCR metadata id: meta-ghcr uses: docker/metadata-action@v5 with: images: ${{ env.GHCR_IMAGE }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha
# TODO: Re-enable once ATCR rate limit issue is resolved # - name: Extract ATCR metadata # id: meta-atcr # uses: docker/metadata-action@v5 # with: # images: ${{ env.ATCR_IMAGE }} # tags: | # type=semver,pattern={{version}} # type=semver,pattern={{major}}.{{minor}} # type=semver,pattern={{major}} # type=sha
- name: Build and push to GHCR by digest id: build uses: docker/build-push-action@v5 with: context: . platforms: ${{ matrix.platform }} labels: ${{ steps.meta-ghcr.outputs.labels }} build-args: | HAPPYVIEW_VERSION=${{ github.event.release.tag_name }} cache-from: type=gha,scope=build-${{ matrix.platform }} cache-to: type=gha,scope=build-${{ matrix.platform }},mode=max,ignore-error=true outputs: type=image,"name=${{ env.GHCR_IMAGE }}",push-by-digest=true,name-canonical=true,push=true
# TODO: Re-enable once ATCR rate limit issue is resolved # - name: Push to ATCR by digest # id: build-atcr # continue-on-error: true # uses: docker/build-push-action@v5 # with: # context: . # platforms: ${{ matrix.platform }} # labels: ${{ steps.meta-atcr.outputs.labels }} # build-args: | # HAPPYVIEW_VERSION=${{ github.event.release.tag_name }} # cache-from: type=gha,scope=build-${{ matrix.platform }} # outputs: type=image,"name=${{ env.ATCR_IMAGE }}",push-by-digest=true,name-canonical=true,push=true
- name: Create GHCR manifest run: | GHCR_TAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< '${{ steps.meta-ghcr.outputs.json }}') docker buildx imagetools create --append $GHCR_TAGS \ ${{ env.GHCR_IMAGE }}@${{ steps.build.outputs.digest }} 2>/dev/null || \ docker buildx imagetools create $GHCR_TAGS \ ${{ env.GHCR_IMAGE }}@${{ steps.build.outputs.digest }}
# TODO: Re-enable once ATCR rate limit issue is resolved # - name: Create ATCR manifest # if: steps.build-atcr.outcome == 'success' # continue-on-error: true # run: | # ATCR_TAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< '${{ steps.meta-atcr.outputs.json }}') # if [ -n "$ATCR_TAGS" ]; then # docker buildx imagetools create --append $ATCR_TAGS \ # ${{ env.ATCR_IMAGE }}@${{ steps.build-atcr.outputs.digest }} 2>/dev/null || \ # docker buildx imagetools create $ATCR_TAGS \ # ${{ env.ATCR_IMAGE }}@${{ steps.build-atcr.outputs.digest }} # fi