mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 10:30:15 -05:00
e193c848fe
Conflicts: - `config/initializers/content_security_policy.rb`: Upstream added some code to add the Identity Provider's sign-in endpoint to the `form-action` Content Security Policy directive but our version of the file is pretty different. Ported the change.
42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
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
|
|
# This is only allowed to run if:
|
|
# - the PR branch is in the `mastodon/mastodon` repository
|
|
# - the PR is not a draft
|
|
# - the PR has the "build-image" label
|
|
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }}
|
|
steps:
|
|
# Repository needs to be cloned so `git rev-parse` below works
|
|
- name: Clone repository
|
|
uses: actions/checkout@v4
|
|
- id: version_vars
|
|
run: |
|
|
echo mastodon_version_metadata=pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
|
|
outputs:
|
|
metadata: ${{ steps.version_vars.outputs.mastodon_version_metadata }}
|
|
|
|
build-image:
|
|
needs: compute-suffix
|
|
uses: ./.github/workflows/build-container-image.yml
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
use_native_arm64_builder: false
|
|
push_to_images: |
|
|
ghcr.io/${{ github.repository_owner }}/mastodon
|
|
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
|
|
flavor: |
|
|
latest=auto
|
|
tags: |
|
|
type=ref,event=pr
|
|
secrets: inherit
|