thermograph/.forgejo/workflows/frontend-deploy-prod.yml
Emi Griffith 7b2db07722 CI: port the split repos' workflows to per-domain path-filtered monorepo pipelines
One root workflow set replaces the four repos' copies (deleted -- root-only
is where Forgejo reads them, and dead copies are a trap): per-domain
build-push with explicit image paths (emi/thermograph/backend|frontend; the
old github.repository-derived path collides in a monorepo), path-filtered
per-domain beta/prod/dev deploys, a domain-input reusable build check, a
single always-reporting PR gate (path-filtered required checks deadlock
auto-merge), a new infra-sync pipeline (host checkout + secrets render on
infra/** pushes), and ports of secrets-guard / ops-cron /
observability-validate to monorepo paths.
2026-07-22 22:11:33 -07:00

51 lines
1.9 KiB
YAML

name: Deploy frontend to prod VPS
# On a push to `release` that touches frontend/**, SSH to prod and roll ONLY
# the frontend service onto the image frontend-build-push.yml published for this
# commit. Same shape as frontend-deploy.yml (the `main`->beta path) against a
# completely separate secret set (PROD_SSH_HOST/USER/KEY/PORT) so a beta
# credential leak can't reach prod. Backend deploys itself independently via
# backend-deploy-prod.yml -- a frontend change ships to prod without touching
# backend and vice versa, exactly as in the split era.
#
# The tag MUST match frontend-build-push.yml's `sha-${GITHUB_SHA:0:12}` (12
# hex) -- see frontend-deploy.yml for why it's truncated here. deploy.sh
# retries the pull because the build for this push may still be in flight.
#
# Frontend's own register() fetches the IndexNow key from backend at boot, so
# deploy.sh waits on a healthy backend before declaring the frontend roll OK
# (its compose depends_on already encodes that ordering).
on:
push:
branches: [release]
paths: ['frontend/**']
workflow_dispatch: {}
concurrency:
group: prod-deploy-frontend
cancel-in-progress: false
jobs:
deploy:
runs-on: docker
steps:
- name: Compute image tag
id: tag
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
- name: Deploy frontend over SSH
uses: https://github.com/appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.PROD_SSH_HOST }}
username: ${{ secrets.PROD_SSH_USER }}
key: ${{ secrets.PROD_SSH_KEY }}
port: ${{ secrets.PROD_SSH_PORT }}
# Forward the target service + the image tag to run. deploy.sh reads
# FRONTEND_IMAGE_TAG and rolls just `frontend`.
envs: SERVICE,FRONTEND_IMAGE_TAG
script: /opt/thermograph/infra/deploy/deploy.sh
env:
SERVICE: frontend
FRONTEND_IMAGE_TAG: ${{ steps.tag.outputs.tag }}