-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
4 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
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,15 @@ | ||
{% extends "base.html" %} | ||
|
||
<!-- prevent caching --> | ||
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" /> | ||
<meta http-equiv="cache-control" content="max-age=0" /> | ||
<meta http-equiv="expires" content="0" /> | ||
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> | ||
<meta http-equiv="pragma" content="no-cache" /> | ||
|
||
{% block outdated %} | ||
You're not viewing the latest released version. | ||
<a href="{{ '../' ~ base_url }}"> | ||
<strong>Click here to go to latest release.</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: # yamllint disable-line rule:truthy | |
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
|
@@ -19,15 +21,34 @@ jobs: | |
|
||
- name: Install dependencies | ||
run: | | ||
pip install mkdocs mkdocs-material \ | ||
pip install mkdocs mkdocs-material mike \ | ||
mkdocs-awesome-pages-plugin beautifulsoup4 lxml | ||
- name: Copy all to docs folder | ||
run: | | ||
mkdir -p docs | ||
shopt -s extglob | ||
mv !(docs) docs/ | ||
- name: Build and Deploy | ||
run: mkdocs gh-deploy --force --config-file .github/mkdocs.yaml | ||
- name: Deploy documentation | ||
run: | | ||
if [[ "${{ github.ref_type }}" == "tag" ]]; then | ||
TAG=${{ github.ref_name }} | ||
VERSION=$(echo ${TAG} | awk -F'.' '{print $1"."$2}') | ||
fi | ||
export BASE_URL=${BASE_URL}/${TAG:-main} | ||
git fetch origin ${DOCS_BRANCH} --depth=1 | ||
mike deploy -F ${DOCS_CONFIG} \ | ||
--push --branch ${DOCS_BRANCH} \ | ||
--update-aliases ${VERSION:-main} latest | ||
mike set-default -F ${DOCS_CONFIG} \ | ||
--push --branch ${DOCS_BRANCH} latest | ||
env: | ||
BASE_URL: https://github.com/SciCatProject/scicatlive/blob/main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_COMMITTER_NAME: ci-bot | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
BASE_URL: https://github.com/SciCatProject/scicatlive/blob | ||
DOCS_BRANCH: gh-pages | ||
DOCS_CONFIG: .github/mkdocs.yaml |