ci: the image job never ran — fix condition, tag :latest, deploy for real #16
@@ -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