Compare commits

...
2 Commits
Author SHA1 Message Date
sneak f7e713ee68 Notify sneak's ntfy topic on every CI deploy (closes #48)
check / check (push) Successful in 2m54s
Add a notify job to the deploy workflow that posts an ntfy message on
success or failure, using the topic from secrets.NTFY_TOPIC.

Model: deepseek-v4-pro
2026-11-05 20:22:48 +00:00
clawbot dc5e368d2b Make script/lint fail on any Hugo warning (closes #25)
check / check (push) Canceled after 0s
The lint step in Dockerfile.lint now passes --panicOnWarning alongside
--printPathWarnings. Until now Hugo printed "Duplicate target paths"
when two pages wrote the same output file and still exited 0, so the
lint passed while one page was silently lost. The flag turns that
warning, and every other Hugo warning, into a failed lint.

script/test and the deploy build are unchanged. The comments in
Dockerfile.lint, script/lint and script/check, the README entry for
script/lint, and TODO.md now describe the stricter lint.

Model: opus-5-5
2026-10-21 15:06:16 +02:00
6 changed files with 77 additions and 19 deletions
+40
View File
@@ -108,3 +108,43 @@ jobs:
run: wrangler pages deploy public --project-name=lora-vegas --branch=${{ github.ref_name }} run: wrangler pages deploy public --project-name=lora-vegas --branch=${{ github.ref_name }}
env: env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
notify:
runs-on: ubuntu-latest
needs: [build, deploy]
# Run whether the build and deploy passed or failed. The Notify step
# carries continue-on-error: true so a notification that cannot be sent
# leaves the deploy's result exactly as it was.
if: always()
container:
# node 20.20.2-bookworm, 2026-08-09. Same pinned image as the deploy
# job, chosen because it ships curl; no extra packages to install.
image: node@sha256:8f693eaa7e0a8e71560c9a82b55fd54c2ae920a2ba5d2cde28bac7d1c01c9ba5
steps:
# needs.deploy.result is "success" only when the deploy job actually
# published; anything else -- a failed build, a failed deploy, a
# cancelled run -- is reported as a failure with a link to the run.
- name: Notify
# curl failing (ntfy unreachable or erroring, or NTFY_TOPIC
# absent) must not fail the run, so continue-on-error lives on
# this step and not on the job: on this Gitea a job-level flag
# still marks the job failed and reddens the commit.
continue-on-error: true
env:
RESULT: ${{ needs.deploy.result }}
NTFY_TOPIC: ${{ secrets.NTFY_TOPIC }}
run: |
short="$(printf '%.7s' "$GITHUB_SHA")"
run_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
if [ "$RESULT" = success ]; then
curl -fsS --max-time 10 \
-H "Title: lora.vegas deployed from $GITHUB_REF_NAME" \
-d "$short deployed to https://lora.vegas/" \
"https://ntfy.sh/$NTFY_TOPIC"
else
curl -fsS --max-time 10 \
-H "Title: lora.vegas deploy from $GITHUB_REF_NAME failed" \
-H "Priority: high" \
-d "Run: $run_url" \
"https://ntfy.sh/$NTFY_TOPIC"
fi
+7 -4
View File
@@ -21,9 +21,11 @@
# so calling it from inside would recurse into a docker build with no # so calling it from inside would recurse into a docker build with no
# daemon. # daemon.
# #
# This repo's lint is a clean Hugo build that surfaces broken internal # This repo's lint is a Hugo build that fails on any build error and on
# links and template path problems: `hugo` fails on build errors and # any Hugo warning. --printPathWarnings makes Hugo warn when two pages
# --printPathWarnings reports render-target collisions. # write the same output path, and --panicOnWarning turns that warning,
# and every other one, into a failed build. Only the lint is this strict:
# script/test and the deploy build stay plain `hugo --minify`.
# alpine 3.21, 2026-02-28 # alpine 3.21, 2026-02-28
FROM alpine@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709 FROM alpine@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709
@@ -58,4 +60,5 @@ COPY . .
# references. # references.
ARG CHECK_EPOCH ARG CHECK_EPOCH
RUN [ -n "$CHECK_EPOCH" ] || exit 1 RUN [ -n "$CHECK_EPOCH" ] || exit 1
RUN echo "lint epoch: ${CHECK_EPOCH}" && hugo --minify --printPathWarnings RUN echo "lint epoch: ${CHECK_EPOCH}" && \
hugo --minify --printPathWarnings --panicOnWarning
+4 -3
View File
@@ -66,9 +66,10 @@ provide:
git pre-commit hook git pre-commit hook
- `script/test` — the correctness check: a clean `hugo --minify` production - `script/test` — the correctness check: a clean `hugo --minify` production
build build
- `script/lint` — a clean build that surfaces broken links and path collisions, - `script/lint` — a Hugo build that fails on any Hugo warning, including two
run inside Docker: it builds `Dockerfile.lint`, where the lint is a build pages that write the same output path, run inside Docker: it builds
step, so a successful build is a clean lint `Dockerfile.lint`, where the lint is a build step, so a successful build is a
clean lint
- `script/fmt` — format every markdown and CSS file in the repo with prettier; - `script/fmt` — format every markdown and CSS file in the repo with prettier;
the exclusions live in `.prettierignore` with the reason for each the exclusions live in `.prettierignore` with the reason for each
- `script/fmt-check` — check that formatting (read-only) - `script/fmt-check` — check that formatting (read-only)
+17 -4
View File
@@ -34,6 +34,23 @@ leaning on `.gitignore` (https://git.eeqj.de/sneak/lora.vegas/issues/33).
# Completed Steps # Completed Steps
- 2026-11-05: added a `notify` job to the deploy workflow that posts an ntfy
message on every deploy, success or failure (closes
https://git.eeqj.de/sneak/lora.vegas/issues/48). The job runs `if: always()`
so it fires whether the build and deploy passed or failed, and the Notify step
carries `continue-on-error: true` so a notification that cannot be sent leaves
the deploy's result exactly as it was. On success the message body is the
short commit plus the site URL, and on failure it is a link to the run. The
topic comes from the `NTFY_TOPIC` Actions secret, which sneak must add before
anything is sent; the topic is never written in the repository. Both curl
calls carry `--max-time 10` so a stalled ntfy cannot hold the run open
- 2026-10-21: made `script/lint` fail when two pages write the same output path
(https://git.eeqj.de/sneak/lora.vegas/issues/25). `Dockerfile.lint` now runs
`hugo --minify --printPathWarnings --panicOnWarning`. `--printPathWarnings`
makes Hugo warn about the collision, and `--panicOnWarning` turns that warning
and every other Hugo warning into a failed lint; until now the warning was
printed and the lint still exited 0. `script/test` and the deploy build stay
plain `hugo --minify`
- 2026-08-10: added the `cibuild` and `precommit` targets to the `Makefile` - 2026-08-10: added the `cibuild` and `precommit` targets to the `Makefile`
(https://git.eeqj.de/sneak/lora.vegas/issues/34). Both scripts already (https://git.eeqj.de/sneak/lora.vegas/issues/34). Both scripts already
existed, were already documented, and are the two entrypoints a contributor is existed, were already documented, and are the two entrypoints a contributor is
@@ -328,10 +345,6 @@ outside this repo, so nothing there may be picked up as the Next Step.
## Blocked ## Blocked
- Decide whether `script/lint` should fail on render-target collisions rather
than only print them; `--printPathWarnings` exits 0 today, so the signal is
reported and not enforced. Owner call, since it changes what the gate rejects
(https://git.eeqj.de/sneak/lora.vegas/issues/25)
- Move the artifact actions in `.gitea/workflows/deploy.yml` to v4 once this - Move the artifact actions in `.gitea/workflows/deploy.yml` to v4 once this
Gitea Actions instance serves the v4 artifact protocol; they are pinned on the Gitea Actions instance serves the v4 artifact protocol; they are pinned on the
deprecated v3 line because v4 fails here deprecated v3 line because v4 fails here
+1 -1
View File
@@ -2,7 +2,7 @@
# script/check: run all checks. Our own extension to # script/check: run all checks. Our own extension to
# scripts-to-rule-them-all. Must not modify any tracked files. Runs the # scripts-to-rule-them-all. Must not modify any tracked files. Runs the
# canonical order: the clean production build, then the lint build that # canonical order: the clean production build, then the lint build that
# reports path warnings, then the read-only formatting check. # fails on any Hugo warning, then the read-only formatting check.
# #
# The lint - and only the lint - runs inside Docker: it is a build of # The lint - and only the lint - runs inside Docker: it is a build of
# Dockerfile.lint, so this script needs a working docker daemon and has # Dockerfile.lint, so this script needs a working docker daemon and has
+8 -7
View File
@@ -1,12 +1,13 @@
#!/bin/sh #!/bin/sh
# script/lint: run the lint. This Hugo site has no dedicated linter, so # script/lint: run the lint. This Hugo site has no dedicated linter, so
# the lint gate is a clean build that surfaces broken internal links and # the lint is a Hugo build that fails on any build error and on any Hugo
# template path problems -- but where it runs is not negotiable: every # warning, including two pages that write the same output path. Where
# lint run happens inside a Docker container, so this script does # it runs is not negotiable. Every lint run happens inside a Docker
# nothing except build Dockerfile.lint. The lint is a build step there, # container, so this script does nothing except build Dockerfile.lint.
# so a successful build is a clean lint. There is deliberately no host # The lint is a build step there, so a successful build is a clean lint.
# fallback and no "already inside a container?" branch: either would be # There is deliberately no host fallback and no "already inside a
# a host lint path wearing a disguise. # container?" branch: either would be a host lint path wearing a
# disguise.
# #
# No --target: Dockerfile.lint has exactly one stage, so the whole-file # No --target: Dockerfile.lint has exactly one stage, so the whole-file
# build IS the lint. See that file for why a second, sibling stage would # build IS the lint. See that file for why a second, sibling stage would