ci: publish main to production immediately during active development
This commit is contained in:
parent
1e648c90ac
commit
bd0d9f2cbe
29
.github/workflows/promote-production.yml
vendored
29
.github/workflows/promote-production.yml
vendored
@ -1,44 +1,27 @@
|
|||||||
name: Caterium Promote Production
|
name: Caterium Direct Production
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
push:
|
||||||
workflows: ["Caterium QA"]
|
branches: [main]
|
||||||
types: [completed]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: caterium-production-promotion
|
group: caterium-production-promotion
|
||||||
cancel-in-progress: false
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
promote:
|
promote:
|
||||||
if: >-
|
|
||||||
${{ github.event.workflow_run.conclusion == 'success' &&
|
|
||||||
github.event.workflow_run.event == 'push' &&
|
|
||||||
github.event.workflow_run.head_branch == 'main' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout verified main
|
- name: Checkout current main
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Verify promoted commit
|
- name: Publish immediately to production branch
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
expected="${{ github.event.workflow_run.head_sha }}"
|
|
||||||
actual="$(git rev-parse HEAD)"
|
|
||||||
if [ "$actual" != "$expected" ]; then
|
|
||||||
echo "Refusing promotion: main moved after the verified QA run."
|
|
||||||
echo "verified=$expected current=$actual"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Promote to production branch
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user