fix(ci): make production deploy manual only
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
name: Deploy to Production
|
name: Deploy to Production
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
|
||||||
workflows: ["Prepare Release"]
|
|
||||||
types: [completed]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
release:
|
release:
|
||||||
@@ -25,7 +22,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to Production
|
name: Deploy to Production
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
outputs:
|
outputs:
|
||||||
@@ -94,30 +91,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Validate Release Chain
|
- name: Validate Release Chain
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_run" ]; then
|
RELEASE_TAG="${{ steps.fetch.outputs.tag }}"
|
||||||
EXPECTED_SHA="${{ github.event.workflow_run.head_sha }}"
|
RELEASE_SHA="${RELEASE_TAG##*.}"
|
||||||
RELEASE_TAG="${{ steps.fetch.outputs.tag }}"
|
echo "✓ Workflow dispatch mode — release chain verification is manual"
|
||||||
RELEASE_SHA="${RELEASE_TAG##*.}"
|
echo " Selected release: $RELEASE_TAG"
|
||||||
EXPECTED_SHA_SHORT="${EXPECTED_SHA:0:${#RELEASE_SHA}}"
|
echo " Extracted commit suffix: $RELEASE_SHA"
|
||||||
|
|
||||||
if [ "$EXPECTED_SHA_SHORT" != "$RELEASE_SHA" ]; then
|
|
||||||
echo "ERROR: Release SHA does not match upstream workflow SHA"
|
|
||||||
echo "Expected: $EXPECTED_SHA"
|
|
||||||
echo "Expected short: $EXPECTED_SHA_SHORT"
|
|
||||||
echo "Release: $RELEASE_SHA"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✓ Release chain verified: $EXPECTED_SHA_SHORT"
|
|
||||||
else
|
|
||||||
echo "✓ Workflow dispatch mode — release chain verification skipped"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Validate Upstream CI Success
|
- name: Validate Upstream CI Success
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
REPO: ${{ env.REPO }}
|
REPO: ${{ env.REPO }}
|
||||||
EXPECTED_SHA: ${{ github.event.workflow_run.head_sha }}
|
EXPECTED_SHA: ${{ steps.fetch.outputs.commit }}
|
||||||
run: |
|
run: |
|
||||||
python3 - <<'PY'
|
python3 - <<'PY'
|
||||||
import json
|
import json
|
||||||
@@ -129,8 +113,8 @@ jobs:
|
|||||||
repo = os.environ["REPO"]
|
repo = os.environ["REPO"]
|
||||||
expected_sha = os.environ.get("EXPECTED_SHA", "")
|
expected_sha = os.environ.get("EXPECTED_SHA", "")
|
||||||
if not expected_sha:
|
if not expected_sha:
|
||||||
print("✓ Workflow dispatch mode — upstream CI validation skipped")
|
print("ERROR: missing expected release commit")
|
||||||
sys.exit(0)
|
sys.exit(1)
|
||||||
|
|
||||||
matched_ci = None
|
matched_ci = None
|
||||||
for page in range(1, 6):
|
for page in range(1, 6):
|
||||||
|
|||||||
Reference in New Issue
Block a user