diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 86667c3..7519a0b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -130,21 +130,24 @@ jobs: name: site path: site - # Only the version being built is replaced; every other version stays as - # it is, and /docs/latest/ follows the newest. + - uses: actions/setup-go@v6 + with: + go-version: '1.27.2' + + # ⛔ THE VERSION GOES AT THE BRANCH ROOT. This step used to write + # docs// — but a project repository named "docs" is ALREADY + # served at /docs/, so the site landed at /docs/docs// while + # /docs/latest/ went on serving the MkDocs build mike had left there. + # Both URLs answered 200, which is why the green deploy said nothing. + # + # pagespublish replaces that version and nothing else, writes + # versions.json in mike's format (what the Hextra fork's version selector + # reads), points latest at the newest release, leaves the root + # redirecting to it, and removes the misplaced docs/ directory once. - name: Publish ${{ needs.build.outputs.version }} - working-directory: gh-pages - run: | - version="${{ needs.build.outputs.version }}" - rm -rf "docs/${version}" - mkdir -p "docs/${version}" - cp -R ../site/. "docs/${version}/" - newest=$(ls docs | grep -E '^[0-9]+\.[0-9]+$' | sort -t. -k1,1n -k2,2n | tail -1 || true) - if [ -n "${newest}" ]; then - rm -rf docs/latest - cp -R "docs/${newest}" docs/latest - fi - touch .nojekyll + run: >- + go run github.com/go-fleettools/fleettools/cmd/pagespublish@v0.26.0 + "${{ needs.build.outputs.version }}" site gh-pages - name: Push gh-pages working-directory: gh-pages