You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1015 B
35 lines
1015 B
1 year ago
|
name: Build container image for PR
|
||
|
on:
|
||
|
pull_request:
|
||
|
types: [labeled, synchronize, reopened, ready_for_review, opened]
|
||
|
|
||
|
permissions:
|
||
|
contents: read
|
||
|
packages: write
|
||
|
|
||
|
jobs:
|
||
|
compute-suffix:
|
||
|
runs-on: ubuntu-latest
|
||
|
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }}
|
||
|
steps:
|
||
|
- id: version_vars
|
||
|
run: |
|
||
|
echo mastodon_version_suffix=+pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
|
||
|
outputs:
|
||
|
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }}
|
||
|
|
||
|
build-image:
|
||
|
needs: compute-suffix
|
||
|
uses: ./.github/workflows/build-container-image.yml
|
||
|
with:
|
||
|
platforms: linux/amd64,linux/arm64
|
||
|
use_native_arm64_builder: true
|
||
|
push_to_images: |
|
||
|
ghcr.io/mastodon/mastodon
|
||
|
version_suffix: ${{ needs.compute-suffix.outputs.suffix }}
|
||
|
flavor: |
|
||
|
latest=auto
|
||
|
tags: |
|
||
|
type=ref,event=pr
|
||
|
secrets: inherit
|