thermograph/.forgejo/workflows/frontend-deploy-dev.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

65 lines
2.7 KiB
YAML

name: Deploy frontend to LAN dev server
# Fires on a push to `dev` touching frontend/** -- a direct push, or the real
# merge commit a native "auto merge when checks succeed" produces (see
# pr-build.yml). A `build` job (the reusable build.yml sanity check) gates a
# `deploy` job that rolls the LAN dev box.
#
# CUTOVER NOTE (monorepo reunification): the LAN box's ~/thermograph-dev is a
# thermograph-infra checkout from the split era. This job calls
# ~/thermograph-dev/infra/deploy/deploy-dev.sh -- the MONOREPO layout -- so it
# is INERT until ~/thermograph-dev is re-pointed at the monorepo (a fresh
# clone; deploy-dev.sh then self-updates via deploy.sh's git reset like the
# beta/prod paths).
#
# SERVICE=frontend + FRONTEND_IMAGE_TAG is the same env-var contract the
# beta/prod deploy workflows use against infra/deploy/deploy.sh, so a dev-only
# rollout never touches the backend's running container or tag.
on:
push:
branches: [dev]
paths: ['frontend/**']
workflow_dispatch: {}
jobs:
build:
name: build
# Fixed (unparameterized) group: if two frontend pushes to dev land close
# together, the newer push's build cancels the older's still-running one
# on the single physical runner -- the older result would be thrown away
# once needs:build gates its deploy anyway. Safe to cancel mid-run:
# build.yml only runs a throwaway `docker build`, nothing persisted.
concurrency:
group: dev-push-build-frontend
cancel-in-progress: true
uses: ./.forgejo/workflows/build.yml
with:
domain: frontend
deploy:
needs: build
# NOT [self-hosted, thermograph-lan] -- GitHub implicitly tags every
# self-hosted runner with "self-hosted"; Forgejo's runner has only the
# labels it was registered with ("docker" + "thermograph-lan"). The array
# form silently makes this job unschedulable on every push.
runs-on: thermograph-lan
permissions:
contents: read
concurrency:
group: dev-lan-deploy-frontend
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Compute image tag
id: tag
# Same 12-hex truncation the beta/prod deploys use -- must match
# frontend-build-push.yml's `sha-${GITHUB_SHA:0:12}` tag exactly.
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
- name: Deploy to the LAN dev server
# thermograph-lan is host-native (the runner job runs directly on the
# LAN box, not over SSH like beta/prod), so plain env vars on the
# command reach deploy-dev.sh directly -- no ssh-action needed here.
run: SERVICE=frontend FRONTEND_IMAGE_TAG=${{ steps.tag.outputs.tag }} bash "$HOME/thermograph-dev/infra/deploy/deploy-dev.sh"