Skip to content
Merged
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
31 changes: 17 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<version>/ — but a project repository named "docs" is ALREADY
# served at /docs/, so the site landed at /docs/docs/<version>/ 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
Expand Down
Loading