mirror of
https://github.com/penpot/penpot.git
synced 2026-09-24 12:56:15 +00:00
_DEVELOP and _STAGING chain build-bundle.yml -> build-docker.yml, both invoked with gh_ref as a branch name. Each reusable workflow re-resolves that branch with its own checkout, at its own time. build-docker's checkout happens minutes after build-bundle's, after new commits can have landed on the branch, so it can compute a different sha than the one build-bundle actually bundled and uploaded to S3. The Prepare job then requests a key that was never uploaded: fatal error: An error occurred (404) when calling the HeadObject operation: Key "penpot-sha-<newer-sha>.zip" does not exist Expose build-bundle.yml's resolved sha as a workflow_call output and thread it through _DEVELOP, _STAGING and _ADHOC as build-docker.yml's new optional sha input, which pins its checkout instead of re-resolving gh_ref. gh_ref keeps naming the branch tag to move. _TAG is unaffected: it builds from a pushed git tag, which cannot move the way a branch can, so build-bundle and build-docker already agree on one commit there. Signed-off-by: David Barragán Merino <david.barragan@kaleidos.net>
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: _ADHOC
|
|
|
|
run-name: >-
|
|
_ADHOC (${{ inputs.gh_ref }}${{ inputs.nitrate_ref != '' && format(' / nitrate:{0}', inputs.nitrate_ref) || '' }})
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
gh_ref:
|
|
description: 'Branch/ref to build in penpot/penpot'
|
|
type: string
|
|
required: true
|
|
nitrate_ref:
|
|
description: 'Branch/ref to build admin-console in penpot/penpot-nitrate (defaults to gh_ref)'
|
|
type: string
|
|
required: false
|
|
force:
|
|
description: 'Rebuild and overwrite even if already built/promoted'
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
|
|
jobs:
|
|
build-bundle:
|
|
uses: ./.github/workflows/build-bundle.yml
|
|
secrets: inherit
|
|
with:
|
|
gh_ref: ${{ inputs.gh_ref }}
|
|
force: ${{ inputs.force }}
|
|
|
|
build-docker:
|
|
needs: build-bundle
|
|
uses: ./.github/workflows/build-docker.yml
|
|
secrets: inherit
|
|
with:
|
|
gh_ref: ${{ inputs.gh_ref }}
|
|
# Pin the exact commit build-bundle already resolved and uploaded to
|
|
# S3, instead of letting build-docker re-resolve gh_ref on its own
|
|
# checkout minutes later, which can land on a newer commit than the
|
|
# one actually bundled if gh_ref names a branch that moved meanwhile.
|
|
sha: ${{ needs.build-bundle.outputs.sha }}
|
|
force: ${{ inputs.force }}
|
|
|
|
build-docker-admin-console:
|
|
uses: ./.github/workflows/build-docker-admin-console.yml
|
|
secrets: inherit
|
|
with:
|
|
gh_ref: ${{ inputs.nitrate_ref || inputs.gh_ref }}
|
|
force: ${{ inputs.force }}
|