Skip to content

Commit

Permalink
add latest version warning; new workflow for version releases; change…
Browse files Browse the repository at this point in the history
… it to be a main version
  • Loading branch information
sage-wright committed Sep 9, 2024
1 parent e476529 commit da5c14b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@ jobs:
run: |
git config user.name sage-wright
git config user.email [email protected]
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/theiagen/public_health_bioinformatics/releases/latest | jq -r ".tag_name")
mike deploy --push --update-aliases ${LATEST_RELEASE} latest
mike set-default --push latest
mike deploy --push --update-aliases main
39 changes: 39 additions & 0 deletions .github/workflows/build-version-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build-documentation
on:
release:
types: [published]

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Cache dependencies
uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache

- name: Install dependencies
run: |
pip install mkdocs-material mkdocs-material-extensions mkdocs-git-revision-date-localized-plugin mike mkdocs-glightbox
- name: Build documentation
run: |
git config user.name sage-wright
git config user.email [email protected]
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/theiagen/public_health_bioinformatics/releases/latest | jq -r ".tag_name")
mike deploy --push --update-aliases main
mike set-default --push latest
8 changes: 8 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to the latest version.</strong>
</a>
{% endblock %}

0 comments on commit da5c14b

Please sign in to comment.