ci: image to Harbor platform project, orca webhook via repo variable
M-MIG-3/5: the platform cluster (bp-platform-stage) deploys tenant-registry-stage from repo.breakpilot.com/platform/tenant-registry. The image job now logs in with the org secrets REGISTRY_USERNAME / REGISTRY_PASSWORD, pushes under platform/, and POSTs the orca webhook only when the repo variable ORCA_WEBHOOK_URL is set (it no longer targets the core master). release.yaml (env-stage/env-prod promotion against a cluster layout that no longer exists) is removed; prod deploys get their own trigger with the prod node. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
1 parent
9b50b98678
commit
f530bc9cbe
2 files changed
+14
-95
No files matched your search
+14
-10
@@ -112,28 +112,32 @@ jobs:
|
||||
git clone --depth 1 --branch ${GITHUB_REF_NAME} $(echo ${GITHUB_SERVER_URL} | sed -E "s#^(https?://)#\1ci:${{ secrets.GITHUB_TOKEN }}@#")/${GITHUB_REPOSITORY}.git .
|
||||
|
||||
- name: Login
|
||||
# REGISTRY_USERNAME / REGISTRY_PASSWORD are `platform` org secrets
|
||||
# (Harbor robot with push on the platform project).
|
||||
env:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASS: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: echo "$REGISTRY_PASS" | docker login repo.breakpilot.com -u "$REGISTRY_USER" --password-stdin
|
||||
|
||||
- name: Build + push
|
||||
run: |
|
||||
set -eu
|
||||
docker build \
|
||||
-t repo.breakpilot.com/breakpilot/tenant-registry:latest \
|
||||
-t repo.breakpilot.com/breakpilot/tenant-registry:sha-${GITHUB_SHA} \
|
||||
-t repo.breakpilot.com/platform/tenant-registry:latest \
|
||||
-t repo.breakpilot.com/platform/tenant-registry:sha-${GITHUB_SHA} \
|
||||
.
|
||||
docker push repo.breakpilot.com/breakpilot/tenant-registry:latest
|
||||
docker push repo.breakpilot.com/breakpilot/tenant-registry:sha-${GITHUB_SHA}
|
||||
docker push repo.breakpilot.com/platform/tenant-registry:latest
|
||||
docker push repo.breakpilot.com/platform/tenant-registry:sha-${GITHUB_SHA}
|
||||
|
||||
# Notify orca to pull :latest and recreate the service (same pattern as
|
||||
# breakpilot-core/build-pitch-deck.yml). The stage-env deploy this used to
|
||||
# attempt does not exist in this cluster.
|
||||
# Notify the platform cluster master (orca-platform/WEBHOOKS.md) to pull
|
||||
# :latest and recreate tenant-registry-stage. Only when the repo variable
|
||||
# ORCA_WEBHOOK_URL is set (M-MIG-3) — until then the image is pushed and
|
||||
# nothing is deployed.
|
||||
- name: orca deploy webhook
|
||||
if: vars.ORCA_WEBHOOK_URL != ''
|
||||
env:
|
||||
ORCA_WEBHOOK_SECRET: ${{ secrets.ORCA_WEBHOOK_SECRET }}
|
||||
ORCA_WEBHOOK_URL: http://46.225.100.82:6880/api/v1/webhooks/github
|
||||
ORCA_WEBHOOK_URL: ${{ vars.ORCA_WEBHOOK_URL }}
|
||||
run: |
|
||||
set -eu
|
||||
PAYLOAD="{\"ref\":\"refs/heads/main\",\"repository\":{\"full_name\":\"${GITHUB_REPOSITORY}\"},\"head_commit\":{\"id\":\"${GITHUB_SHA}\",\"message\":\"ci: tenant-registry image build\"}}"
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
# release.yaml — production release on git tag vX.Y.Z.
|
||||
# Promotes the image already on stage to prod, gated by manual sign-off.
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*.*.*']
|
||||
|
||||
jobs:
|
||||
promote:
|
||||
runs-on: docker
|
||||
environment:
|
||||
name: production # Gitea Environments — requires sign-off per branch protection
|
||||
url: https://breakpilot.com
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
|
||||
- name: extract version
|
||||
id: v
|
||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: verify stage soak (>= 24h on this image)
|
||||
run: |
|
||||
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:env-stage
|
||||
SOAK_SECONDS=$(orca image-age --env=stage --image $IMG)
|
||||
if [ "$SOAK_SECONDS" -lt 86400 ]; then
|
||||
echo "Stage soak only $SOAK_SECONDS s, < 24h. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_STAGE_TOKEN }}
|
||||
|
||||
- name: re-tag image as semver + env-prod
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: repo.breakpilot.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- run: |
|
||||
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}
|
||||
docker pull $IMG:env-stage
|
||||
docker tag $IMG:env-stage $IMG:v${{ steps.v.outputs.version }}
|
||||
docker tag $IMG:env-stage $IMG:env-prod
|
||||
docker push $IMG:v${{ steps.v.outputs.version }}
|
||||
docker push $IMG:env-prod
|
||||
|
||||
- name: deploy to prod
|
||||
run: orca apply --env=prod --image-tag=v${{ steps.v.outputs.version }}
|
||||
env:
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_PROD_TOKEN }}
|
||||
|
||||
- name: post-deploy smoke
|
||||
run: orca exec --env=prod smoke-runner
|
||||
|
||||
- name: generate release notes from conventional commits
|
||||
uses: orhun/git-cliff-action@v3
|
||||
with:
|
||||
config: cliff.toml
|
||||
args: --latest --strip header
|
||||
env:
|
||||
OUTPUT: RELEASE_NOTES.md
|
||||
|
||||
- name: create Gitea release
|
||||
run: |
|
||||
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -Rs '{tag_name:"v${{ steps.v.outputs.version }}", name:"v${{ steps.v.outputs.version }}", body:.}' < RELEASE_NOTES.md)" \
|
||||
https://git.breakpilot.com/api/v1/repos/${{ github.repository }}/releases
|
||||
|
||||
rollback-on-failure:
|
||||
needs: promote
|
||||
if: failure()
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: orca rollback prod
|
||||
run: orca rollout undo ${{ github.event.repository.name }} --env=prod
|
||||
env:
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_PROD_TOKEN }}
|
||||
- name: page on-call
|
||||
run: |
|
||||
curl -X POST -H "Content-Type: application/json" \
|
||||
-d '{"text":"Release of ${{ github.event.repository.name }} ${{ github.ref }} FAILED. Rolled back. See Gitea Actions run."}' \
|
||||
${{ secrets.ONCALL_WEBHOOK }}
|
||||
Reference in new issue
Block a user