diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 06098528..d4abcf2d 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -85,8 +85,10 @@ jobs: npm run build -- --mode preview --base "$base" # Recorded so the publish job can refuse a build made for the wrong - # path, instead of publishing a page that loads nothing. - printf '%s' "$base" > dist/.preview-base + # path, instead of publishing a page that loads nothing. Not a + # dotfile: actions/upload-artifact leaves hidden files out of the + # artifact by default, and this has to survive the trip. + printf '%s' "$base" > dist/preview-base # A CNAME means something only at the site root, and the root belongs # to the production deploy. diff --git a/.github/workflows/pr-deploy.yml b/.github/workflows/pr-deploy.yml index f25c7d77..70a7cd96 100644 --- a/.github/workflows/pr-deploy.yml +++ b/.github/workflows/pr-deploy.yml @@ -178,13 +178,13 @@ jobs: # blank, which is worth an error rather than a puzzled contributor. # Stripped of anything but path characters before being echoed, since # the file came from the build. - built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/.preview-base 2>/dev/null || true)" + built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/preview-base 2>/dev/null || true)" if [ "$built_base" != "$EXPECTED_BASE" ]; then echo "::error::this build is for '${built_base:-}' but the site serves '${EXPECTED_BASE}'." echo "::error::set PREVIEW_PUBLIC_BASE=${{ needs.resolve.outputs.base_path }} in frontend/.env.preview" exit 1 fi - rm -f preview/.preview-base + rm -f preview/preview-base - name: Publish to gh-pages env: