Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/deploy-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ name: deploy-api

on:
push:
# Include feature branches matching feat/cloud-gate-* so we can verify
# the deploy pipeline before merging to main. Production deploys still
# gate on main.
branches: [main, "feat/cloud-gate-**"]
branches: [main]
paths:
- "apps/api/**"
- "packages/api/**"
Expand All @@ -41,6 +38,9 @@ concurrency:

jobs:
deploy:
# Every step below targets the production Fly app, so a manual dispatch
# from any other branch must not run it.
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -110,19 +110,16 @@ jobs:
https://stackpanel-api.fly.dev/health

# Idempotent ACME cert + Cloudflare A/AAAA records pointing at the
# Fly app's IPs. Skipped on dev (the .fly.dev hostname is enough)
# and only kicks in for production / staging / pr-N stages — see
# apps/api/alchemy.run.ts.
# Fly app's IPs for the production stage (see apps/api/alchemy.run.ts).
- name: Bind public hostname
if: github.ref_name == 'main' || github.ref_name == 'develop' || github.event_name == 'pull_request'
env:
FLY_IO_API_KEY: ${{ secrets.FLY_API_TOKEN }}
# Cloudflare credentials come from the SOPS deploy scope via
# loadDeployEnv (shared/cloudflare-api-token — the "Alchemy Token",
# which carries Zone DNS Read/Write for the record steps). Don't
# set CLOUDFLARE_API_TOKEN here: the repo has no such GH secret and
# an empty env var would shadow the SOPS-provided value.
STAGE: ${{ github.ref_name == 'main' && 'production' || github.ref_name == 'develop' && 'staging' || format('pr-{0}', github.event.pull_request.number) }}
STAGE: production
working-directory: apps/api
run: bunx alchemy deploy --stage "$STAGE"

Loading