ci: the image job never ran — fix its condition, tag :latest, deploy for real
Three defects left the deployment frozen on an Aug-06 image while five
RBAC merges landed on main:
1. The job-level `hashFiles('Dockerfile')` condition evaluates BEFORE
checkout, against an empty workspace — always '', so the job was
silently skipped on every push to main.
2. Had it run, it pushed only sha-* and env-stage tags; orca deploys
:latest, which nothing ever updated.
3. The final step ran `orca apply --env=stage` against a stage
environment this cluster does not have.
Now: condition without hashFiles (the Dockerfile is not optional),
:latest tagged alongside sha-*, and the deploy step replaced with the
HMAC-signed orca webhook the other repos use (registered on the master;
ORCA_WEBHOOK_SECRET set as a repo Actions secret).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
739b19341c
commit
fa07b3bae0
@@ -94,7 +94,10 @@ jobs:
|
||||
|
||||
image:
|
||||
needs: [shared, test]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && hashFiles('Dockerfile') != ''
|
||||
# NOTE: no hashFiles() here — at job level it evaluates BEFORE checkout
|
||||
# against an empty workspace, so the old condition was always false and
|
||||
# this job silently never ran (deployment sat on an Aug-06 image).
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -110,13 +113,26 @@ jobs:
|
||||
push: true
|
||||
tags: |
|
||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:env-stage
|
||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:latest
|
||||
|
||||
- uses: anchore/sbom-action@v0
|
||||
with:
|
||||
image: repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||
|
||||
- name: orca deploy stage
|
||||
run: orca apply --env=stage --image-tag=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.
|
||||
- name: orca deploy webhook
|
||||
env:
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_STAGE_TOKEN }}
|
||||
ORCA_WEBHOOK_SECRET: ${{ secrets.ORCA_WEBHOOK_SECRET }}
|
||||
ORCA_WEBHOOK_URL: http://46.225.100.82:6880/api/v1/webhooks/github
|
||||
run: |
|
||||
set -euo pipefail
|
||||
PAYLOAD="{\"ref\":\"refs/heads/main\",\"repository\":{\"full_name\":\"${GITHUB_REPOSITORY}\"},\"head_commit\":{\"id\":\"${GITHUB_SHA}\",\"message\":\"ci: tenant-registry image build\"}}"
|
||||
SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$ORCA_WEBHOOK_SECRET" -r | awk '{print $1}')
|
||||
curl -sSf -k \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-GitHub-Event: push" \
|
||||
-H "X-Hub-Signature-256: sha256=$SIG" \
|
||||
-d "$PAYLOAD" \
|
||||
"$ORCA_WEBHOOK_URL"
|
||||
|
||||
Reference in New Issue
Block a user