Gate deployment on the validated artifact upload result
All checks were successful
Check & deploy / validate (push) Successful in 1m42s
Check & deploy / deploy (push) Successful in 23s

This commit is contained in:
Andras Schmelczer 2026-11-10 20:58:46 +00:00
commit d47162cc90

View file

@ -9,6 +9,8 @@ on:
jobs: jobs:
validate: validate:
outputs:
publish: ${{ steps.validated_build.outcome }}
env: env:
PHOTO_ASSET_CACHE_URL: https://photos.schmelczer.dev/static/photos/ PHOTO_ASSET_CACHE_URL: https://photos.schmelczer.dev/static/photos/
runs-on: runs-on:
@ -50,6 +52,7 @@ jobs:
run: npm run test:e2e run: npm run test:e2e
- name: Save validated build - name: Save validated build
id: validated_build
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }} if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }}
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with: with:
@ -66,7 +69,9 @@ jobs:
${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref, ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
'renovate/')) && 'renovate' || 'docker' }} 'renovate/')) && 'renovate' || 'docker' }}
needs: validate needs: validate
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }} # The upload step evaluates the trusted-main condition on the runner. Pass
# its result to Forgejo's dependent-job scheduler instead of repeating it.
if: ${{ needs.validate.outputs.publish == 'success' }}
steps: steps:
- name: Download validated build - name: Download validated build
uses: https://github.com/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a uses: https://github.com/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a