Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb98391f80 |
@@ -8,10 +8,6 @@ on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
|
||||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
||||
|
||||
jobs:
|
||||
shared:
|
||||
runs-on: docker
|
||||
@@ -112,15 +108,6 @@ jobs:
|
||||
PLAYWRIGHT_TEST_PASS: ${{ secrets.STAGE_TEST_PASS }}
|
||||
|
||||
image:
|
||||
# Builds the portal image and ships it through the same path every
|
||||
# other service in orca-infra uses: push :latest + :sha-<sha> to
|
||||
# repo.breakpilot.com, then POST a github-style payload to the
|
||||
# orca webhook so the master pulls and redeploys breakpilot-portal.
|
||||
#
|
||||
# Webhook target (registered once on the master via
|
||||
# orca webhooks add --repo platform/portal \
|
||||
# --service breakpilot-portal --branch main
|
||||
# ) accepts unsigned payloads — orca matches on repo + branch.
|
||||
needs: [shared, test]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && hashFiles('Dockerfile') != ''
|
||||
runs-on: docker
|
||||
@@ -128,33 +115,18 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: repo.breakpilot.com
|
||||
registry: registry.breakpilot.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
repo.breakpilot.com/breakpilot/portal:latest
|
||||
repo.breakpilot.com/breakpilot/portal:sha-${{ github.sha }}
|
||||
- name: sign image (cosign)
|
||||
run: |
|
||||
{ command -v cosign >/dev/null 2>&1 || curl -sSfLo /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64 || wget -qO /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64; } || echo "::warning::cosign fetch failed"
|
||||
chmod +x /usr/local/bin/cosign 2>/dev/null || true
|
||||
cosign sign --yes --key env://COSIGN_KEY repo.breakpilot.com/breakpilot/portal:latest || echo "::warning::cosign failed"
|
||||
- name: trigger orca redeploy
|
||||
# Signs the POST with HMAC-SHA256 over the JSON body using the
|
||||
# secret orca generated when the webhook was registered. Orca's
|
||||
# endpoint is publicly reachable on the master, so the signature
|
||||
# gates who can fire a deploy.
|
||||
registry.breakpilot.com/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||
registry.breakpilot.com/${{ github.event.repository.name }}:env-stage
|
||||
- uses: anchore/sbom-action@v0
|
||||
with:
|
||||
image: registry.breakpilot.com/${{ github.event.repository.name }}:sha-${{ github.sha }}
|
||||
- run: orca apply --env=stage --image-tag=sha-${{ github.sha }}
|
||||
env:
|
||||
ORCA_WEBHOOK_SECRET: ${{ secrets.ORCA_WEBHOOK_SECRET }}
|
||||
run: |
|
||||
BODY='{"repository":{"full_name":"platform/portal"},"ref":"refs/heads/main"}'
|
||||
SIG="sha256=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$ORCA_WEBHOOK_SECRET" -hex | awk '{print $NF}')"
|
||||
curl -ksSf -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-GitHub-Event: push" \
|
||||
-H "X-Hub-Signature-256: $SIG" \
|
||||
-d "$BODY" \
|
||||
https://46.225.100.82:6880/api/v1/webhooks/github
|
||||
ORCA_TOKEN: ${{ secrets.ORCA_STAGE_TOKEN }}
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
- name: verify stage soak (>= 24h on this image)
|
||||
run: |
|
||||
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}:env-stage
|
||||
IMG=registry.breakpilot.com/${{ github.event.repository.name }}:env-stage
|
||||
SOAK_SECONDS=$(orca image-age --env=stage --image $IMG)
|
||||
if [ "$SOAK_SECONDS" -lt 86400 ]; then
|
||||
echo "Stage soak only $SOAK_SECONDS s, < 24h. Aborting."
|
||||
@@ -34,12 +34,12 @@ jobs:
|
||||
- name: re-tag image as semver + env-prod
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: repo.breakpilot.com
|
||||
registry: registry.breakpilot.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- run: |
|
||||
IMG=repo.breakpilot.com/breakpilot/${{ github.event.repository.name }}
|
||||
IMG=registry.breakpilot.com/${{ github.event.repository.name }}
|
||||
docker pull $IMG:env-stage
|
||||
docker tag $IMG:env-stage $IMG:v${{ steps.v.outputs.version }}
|
||||
docker tag $IMG:env-stage $IMG:env-prod
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -Rs '{tag_name:"v${{ steps.v.outputs.version }}", name:"v${{ steps.v.outputs.version }}", body:.}' < RELEASE_NOTES.md)" \
|
||||
https://git.breakpilot.com/api/v1/repos/${{ github.repository }}/releases
|
||||
https://gitea.meghsakha.com/api/v1/repos/${{ github.repository }}/releases
|
||||
|
||||
rollback-on-failure:
|
||||
needs: promote
|
||||
|
||||
Reference in New Issue
Block a user