ci: the image job never ran — fix condition, tag :latest, deploy for real (#16)
This commit was merged in pull request #16.
This commit is contained in:
@@ -94,7 +94,10 @@ jobs:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
needs: [shared, test]
|
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
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -110,13 +113,26 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
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
|
- uses: anchore/sbom-action@v0
|
||||||
with:
|
with:
|
||||||
image: repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
image: repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||||
|
|
||||||
- name: orca deploy stage
|
# Notify orca to pull :latest and recreate the service (same pattern as
|
||||||
run: orca apply --env=stage --image-tag=sha-${{ github.sha }}
|
# 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:
|
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