diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index fd647e3..e4f7b48 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -6,7 +6,7 @@ on: pull_request: branches: [main] push: - branches: [main] + branches: [main, release/registry-9129e95] jobs: shared: @@ -97,7 +97,9 @@ jobs: # 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' + # Release branch: builds the production image only (9129e95 + #98). + # It pushes :sha- alone and fires no webhook, so stage is untouched. + if: github.event_name == 'push' && github.ref == 'refs/heads/release/registry-9129e95' runs-on: docker # The runner's default job container has no docker CLI, so # docker/login-action + docker/build-push-action die with "Unable to @@ -129,28 +131,7 @@ jobs: docker build \ --build-arg VERSION="$VERSION" \ --build-arg COMMIT="${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/platform/tenant-registry:latest docker push repo.breakpilot.com/platform/tenant-registry:sha-${GITHUB_SHA} - - # 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: ${{ 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\"}}" - 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" + echo "digest: $(docker image inspect -f '{{join .RepoDigests " "}}' repo.breakpilot.com/platform/tenant-registry:sha-${GITHUB_SHA})"