Merge pull request #608 from dalito/gh-docs-redirect-mike2.0

Fix redirect to latest for mike 2.0
This commit is contained in:
Emil Stenström 2024-08-25 16:42:50 +02:00 committed by GitHub
commit 6793aec9b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,17 +56,17 @@ jobs:
if: github.event_name == 'push' && github.ref_name == 'master' && github.ref_type == 'branch'
run: |
export SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
hatch run docs:mike deploy dev --update-aliases --title "dev (${SHORT_SHA})" --push
hatch run docs:mike deploy dev --update-aliases --title "dev (${SHORT_SHA})" --push --alias-type=redirect
- name: Deploy docs (tag)
if: github.ref_type == 'tag' && github.event_name == 'push'
run: |
hatch run docs:mike deploy ${{ github.ref_name }} latest --push --update-aliases
hatch run docs:mike deploy ${{ github.ref_name }} latest --push --update-aliases --alias-type=redirect
hatch run docs:mike set-default latest --push
- name: Deploy docs (Released published)
if: github.event_name == 'release' && github.event.action == 'published' && github.ref_type == 'tag'
run: |
# Version from tag, keep leading v, from github.ref workflow variable
hatch run docs:mike deploy ${{ github.ref_name }} latest --push --update-aliases
hatch run docs:mike deploy ${{ github.ref_name }} latest --push --update-aliases --alias-type=redirect
hatch run docs:mike set-default latest --push