Skip to content

Commit 5c295db

Browse files
Robbie1977claude
andcommitted
Fix the builder image workflow before it is ever activated
Smoke-test the tag the run actually pushed. It tested :latest, which metadata-action only emits on the default branch, so a tag-triggered or manual run would have failed against an image that does not exist. Also assert HUGO_CACHEDIR, working directory and uid, since all three are set in the Dockerfile specifically to override upstream defaults and nothing else would catch a regression. Bump build-push-action to v6 and add setup-buildx-action, matching vfb-status and vfbquery, which already publish into the virtualflybrain namespace with the same org secrets. Make the header say plainly that the image does not exist until this file is moved into .github/workflows/, and correct the description of Robbie1977/docsy-builder: it is a copy of docsy-example rather than a fork, and the Dockerfile on the branch that built the live image is floryn90/hugo:ext-alpine, not klakegg. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1AuLA5tHPwpD7Hp5utPkS
1 parent 6eebb97 commit 5c295db

1 file changed

Lines changed: 36 additions & 11 deletions

File tree

‎themes/vfb-nova/ci/builder-image.yml‎

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22
# git mv themes/vfb-nova/ci/builder-image.yml .github/workflows/builder-image.yml
33
# Parked here because the token used to push this branch has no `workflow`
44
# scope, and GitHub rejects any push touching .github/workflows/ without it.
5+
# Pushing from a checkout with normal credentials has no such problem.
56
#
6-
# Publishes the image the Rancher `hugo` service runs. It lives here, next to
7-
# the site it builds, rather than in Robbie1977/docsy-builder — that repo is a
8-
# fork of docsy-example whose only functional content is a two-line Dockerfile
9-
# (klakegg/hugo + git); everything else in it is Docsy's demo content. Once
10-
# Docsy is gone the name is wrong and the demo content is dead weight, so it
11-
# should be retired rather than rewritten.
7+
# Until it is moved, virtualflybrain/vfb-static-builder DOES NOT EXIST and the
8+
# Rancher service has nothing to pull. This has to happen before the switchover.
9+
#
10+
# Publishes the image the Rancher build service runs. It lives here, next to
11+
# deploy.sh, because deploy.sh is what dictates the image's contents — bash,
12+
# rsync and findutils are in the Dockerfile for its sake. Splitting the two
13+
# across repos is how rcourt/docsy-builder:Feb2023 ended up frozen on a floating
14+
# base tag for two years.
1215
#
1316
# Uses the org-level Docker Hub secrets (DOCKER_HUB_USER / DOCKER_HUB_PASSWORD),
14-
# same as the other VirtualFlyBrain workflows.
17+
# which vfb-status and vfbquery already use to publish into the virtualflybrain
18+
# namespace. Docker Hub creates the repository on first push.
1519
name: builder image
1620

1721
on:
@@ -34,6 +38,8 @@ jobs:
3438
steps:
3539
- uses: actions/checkout@v4
3640

41+
- uses: docker/setup-buildx-action@v3
42+
3743
- name: Log in to Docker Hub
3844
uses: docker/login-action@v3
3945
with:
@@ -51,15 +57,34 @@ jobs:
5157
type=sha,format=short
5258
5359
- name: Build and push
54-
uses: docker/build-push-action@v5
60+
uses: docker/build-push-action@v6
5561
with:
5662
context: .
5763
push: true
5864
tags: ${{ steps.meta.outputs.tags }}
5965
labels: ${{ steps.meta.outputs.labels }}
6066

67+
# Tests the first tag this run actually pushed. The previous version
68+
# tested :latest, which metadata-action only emits on the default branch,
69+
# so a tag-triggered run would have failed on an image that did not exist.
70+
#
71+
# Pin the Rancher service to the sha- tag printed at the end, not :latest.
6172
- name: Smoke test the published image
73+
env:
74+
TAGS: ${{ steps.meta.outputs.tags }}
6275
run: |
63-
docker run --rm virtualflybrain/vfb-static-builder:latest hugo version
64-
docker run --rm --entrypoint /bin/sh virtualflybrain/vfb-static-builder:latest \
65-
-c 'command -v rsync && command -v bash && command -v find'
76+
set -euo pipefail
77+
image=$(printf '%s\n' "$TAGS" | head -n1)
78+
echo "testing $image"
79+
docker run --rm --entrypoint hugo "$image" version
80+
docker run --rm --entrypoint /bin/sh "$image" -c '
81+
set -e
82+
command -v bash
83+
command -v rsync
84+
command -v find
85+
test "$HUGO_CACHEDIR" = /tmp/hugo_cache
86+
test "$(pwd)" = /src
87+
test "$(id -u)" = 0
88+
'
89+
echo "pushed tags:"
90+
printf '%s\n' "$TAGS"

0 commit comments

Comments
 (0)