jj/.github/workflows/docs.yml
Ilya Grigoriev ff810c6097 docs: show version alias in version selector
See https://github.com/martinvonz/jj/pull/3723 for a screenshot.

This will make it clearer to the users that the "latest" and "v0.??.?"
are the same even if the former does not redirect to the latter (but has
identical contents).

MkDocs material lists the *first* alias for each version, so I also
added a "nightly" alias for "prerelease". Otherwise, users would see the
"main" alias, and might get confused whether they should use "latest" or
"main" docs if they don't realize it's named after the "main" branch.

(Upon testing, it still shows "main" for now, but it should be possible
to fix this after this PR is merged by reordering the aliases directly
in `versions.json` on the gh-pages branch)
2024-05-21 16:19:04 -07:00

35 lines
1 KiB
YAML

name: website
on:
push:
branches:
- main
permissions:
contents: write
jobs:
prerelease-docs-build-deploy:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- run: "git fetch origin gh-pages --depth=1"
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: 3.11
- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
with:
poetry-version: latest
- name: Install dependencies, compile and deploy docs
run: |
git config user.name 'jj-docs[bot]'
git config user.email 'jj-docs[bot]@users.noreply.github.io'
.github/scripts/docs-build-deploy 'https://martinvonz.github.io/jj' prerelease nightly main --push
- name: "Show `git diff --stat`"
run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)"