sudosudo #46
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
name: "Push RTD on gh-pages" | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
schedule: | |
# * is a special character in YAML | |
# setup monthly background build | |
- cron: '45 4 20 * *' | |
# gh-pages have a lifetime ? 90 days ? so we do this once a month to refresh | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
sphinx_html_baseurl: 'https://spinalhdl.github.io/VexiiRiscv-RTD/master/' | |
sphinx_github_url: 'https://github.com/SpinalHDL/VexiiRiscv-RTD' | |
sphinx_extra_version: 'master' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "setup python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: "install dependencies" | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y git latexmk | |
sudo pip install -r requirements.txt | |
- name: "check links" | |
run: make linkcheck | |
- name: "Build multiversioned doc" | |
run: sphinx-multiversion source docs/html | |
- name: "add .nojekill and redirect to master" | |
run: | | |
sudo touch docs/html/.nojekyll | |
sudo tee docs/html/index.html << EOF | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Redirecting to ${sphinx_extra_version}</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="refresh" content="0; url=./${sphinx_extra_version}/index.html"> | |
<link rel="canonical" href="${sphinx_html_baseurl}index.html"> | |
</head> | |
</html> | |
EOF | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: docs/html |