forked from wannier-developers/wannier90
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add version warning - Auto deploy docs to `gh-pages` on github release The commit is kept here as a reference. We will switch to readthedocs to deploy multiple versions of the docs, since mike use `gh-pages` branch to host the docs, increasing the size of the repo in the long term. See wannier-developers#485 for more details.
- Loading branch information
1 parent
bc9b851
commit 5746108
Showing
6 changed files
with
115 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
name: Build docs | ||
name: Deploy docs | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- develop | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-w90-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-w90- | ||
- run: pip install -r docs/requirements.txt | ||
- run: mkdocs build -s | ||
working-directory: ./docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ENABLE_MKDOCS_GIT_COMMITTERS: False | ||
deploy_docs: | ||
name: Deploy docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch origin gh-pages --depth=1 | ||
- run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
- run: pip install -r docs/requirements.txt | ||
|
||
# This deploys mkdocs-built html, now we use mike to deploy | ||
# html to have doc versioning. | ||
# | ||
# - run: mkdocs build -s | ||
# working-directory: ./docs | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# ENABLE_MKDOCS_GIT_COMMITTERS: True | ||
# - name: Deploy to GitHub Pages | ||
# uses: peaceiris/actions-gh-pages@v3 | ||
# if: github.ref == 'refs/heads/develop' | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# publish_dir: ./docs/site | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/develop' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/site | ||
- name: mike deploy | ||
run: mike deploy --push --update-aliases ${{ github.ref_name }} latest | ||
working-directory: ./docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ENABLE_MKDOCS_GIT_COMMITTERS: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 latest.</strong> | ||
</a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters