Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47c6725dba |
+22
-46
@@ -94,53 +94,29 @@ jobs:
|
||||
|
||||
image:
|
||||
needs: [shared, test]
|
||||
# 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'
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && hashFiles('Dockerfile') != ''
|
||||
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
|
||||
# locate executable file: docker". Same pattern as the proven
|
||||
# breakpilot-compliance build-push-deploy.yml: run in docker:27-cli
|
||||
# (talks to the runner's daemon) and use plain docker commands.
|
||||
container: docker:27-cli
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
apk add --no-cache git curl openssl
|
||||
git clone --depth 1 --branch ${GITHUB_REF_NAME} $(echo ${GITHUB_SERVER_URL} | sed -E "s#^(https?://)#\1ci:${{ secrets.GITHUB_TOKEN }}@#")/${GITHUB_REPOSITORY}.git .
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Login
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: repo.breakpilot.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||
repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:env-stage
|
||||
|
||||
- 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 }}
|
||||
env:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }}
|
||||
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} \
|
||||
.
|
||||
docker push repo.breakpilot.com/breakpilot/tenant-registry:latest
|
||||
docker push repo.breakpilot.com/breakpilot/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.
|
||||
- name: orca deploy webhook
|
||||
env:
|
||||
ORCA_WEBHOOK_SECRET: ${{ secrets.ORCA_WEBHOOK_SECRET }}
|
||||
ORCA_WEBHOOK_URL: http://46.225.100.82:6880/api/v1/webhooks/github
|
||||
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"
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_STAGE_TOKEN }}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
# /tenant-registry — long-running API server
|
||||
# /migrate — one-shot schema migrator (Orca init container in prod)
|
||||
|
||||
FROM golang:1.25-alpine AS build
|
||||
FROM golang:1.24-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
Reference in New Issue
Block a user