Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 8 additions & 9 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
`ci.yml` runs on pull requests and pushes without production secrets. It covers
backend tests, race tests, `go vet`, frontend lint/build, Docker image builds,
Compose validation, and the deployment script test suite
(`deploy/scripts/deploy_scripts_test.sh`). That suite stubs `docker`, `curl`, and
`nginx` on `PATH`, so it needs no daemon or privileges it exercises slot
(`deploy/scripts/deploy_scripts_test.sh`). That suite stubs `docker`, `curl` and
`nginx` on `PATH`, so it needs no daemon or privileges: it exercises slot
selection, the transactional Nginx switch and its restore-on-failure paths, and
the preflight checks.

Expand All @@ -27,15 +27,14 @@ image SHA.
`rollback.yml` is manual (`workflow_dispatch`) and switches Nginx back to the
other slot, which is already running the previous release. It pulls no images, so
it holds no `packages` permission. It shares the `delta-production-deploy`
concurrency group with `deploy.yml` so a rollback can never interleave with a
concurrency group with `deploy.yml`, so a rollback can never interleave with a
deployment. `slot: auto` targets whichever slot is currently inactive; `blue` or
`green` names one explicitly. To recover an *older* image SHA instead, run
`deploy.yml` manually with that SHA — rollback only moves traffic between the two
slots that are already up.
`green` names one explicitly. Rollback only moves traffic between the two slots
already up; to recover an *older* image SHA, run `deploy.yml` manually with it.

`pages.yml` publishes the committed Swagger spec as a static Swagger UI site on
GitHub Pages (<https://drexeltriangle.github.io/triangle-cms/>). It is independent of
the CI -> Publish -> Deploy chain: it holds no `packages` permission, touches no
slot, and never runs on the self-hosted runner. Swagger UI's assets are vendored
GitHub Pages (<https://drexeltriangle.github.io/triangle-cms/>). It is independent
of the CI -> Publish -> Deploy chain: no `packages` permission, no slot, never on
the self-hosted runner. Swagger UI's assets are vendored
into the artifact at build time from a pinned `swagger-ui-dist`, so the published
page loads nothing from a third-party CDN at runtime.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: npm run build

# The Docker build regenerates the Swagger docs from the handler annotations,
# so the binary always serves a current spec -- but server/docs is also
# so the binary always serves a current spec, but server/docs is also
# committed, and the Pages site publishes that committed copy. Nothing forced
# the two to agree, so annotations could change without a follow-up
# `swag init` and the published reference would drift from the real API with
Expand Down Expand Up @@ -121,8 +121,8 @@ jobs:
run: deploy/scripts/deploy_scripts_test.sh

# The Python in scripts/ was previously untested. A full reseed cannot run
# here -- it needs the WordPress export zip, which is not in the repo, and a
# local Docker stack -- so this covers the parts that can fail silently: the
# here: it needs the WordPress export zip, which is not in the repo, and a
# local Docker stack. This covers the parts that can fail silently: the
# scripts compiling at all, the seed generator's id=0 guarantee, and the
# reseed script's refusal to destroy data unattended.
scripts:
Expand All @@ -142,7 +142,7 @@ jobs:
# The non-TTY guard is the only thing standing between an automated
# context and a destroyed database, so assert it stays a guard: this must
# FAIL to proceed. Without a Docker daemon the run would abort in
# preflight anyway, so accept either refusal -- what is not acceptable is
# preflight anyway, so accept either refusal. What is not acceptable is
# a clean exit, which would mean it sailed past the confirmation.
- name: Refuses to destroy data unattended
run: |
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
fi

# A mention of the mode in a comment must not be mistaken for setting
# it -- that regression would silently skip the preamble.
# it; that regression would silently skip the preamble.
printf -- "-- NO_AUTO_VALUE_ON_ZERO handled upstream\nINSERT INTO articles (\`author_ids\`, \`comment_status\`) VALUES ('y','open');\n" > "$etl/articles.sql"
python ./scripts/generate_wordpress_sql.py "$etl" "$out"
if ! head -1 "$out/02-articles.sql" | grep -q '^SET sql_mode'; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
run: echo "value=$(git rev-parse HEAD:embeddings)" >> "$GITHUB_OUTPUT"

# This image bakes in ~130MB of model weights, so building it is by far the
# slowest step here -- and it was rebuilt on every push to main, including
# slowest step here, and it was rebuilt on every push to main, including
# the overwhelming majority that touch nothing but Go or TypeScript. A tag
# that already exists is by definition built from identical content.
- name: Check whether the embeddings image already exists
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ deploy/*.env
..env.un~

# Local DB dumps (contain cms_users password hashes and cms_sessions).
# Kept here so Borg backs them up -- /var/lib/docker volumes are NOT backed up.
# Kept here so Borg backs them up; /var/lib/docker volumes are NOT backed up.
db-backups/
Loading
Loading