Skip to content

docs-sched-rebuild #864

docs-sched-rebuild

docs-sched-rebuild #864

name: docs-sched-rebuild
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu packages
run: |
sudo apt-get update -y
sudo apt-get install -y pandoc
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools==59.4.0 wheel
python -m pip install -r docs/requirements-doc.txt
- name: Report the versions to build
run: |
sphinx-multiversion --dump-metadata docs/source docs/build/html | jq "keys"
- name: Building docs (multiversion)
run: |
sphinx-multiversion docs/source docs/build/html
- name: Upload HTML
uses: actions/upload-artifact@v2
with:
name: html-build-artifact
path: docs/build/html
if-no-files-found: error
retention-days: 1
# Identify the dir for the HTML.
store-html:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: "gh-pages"
- name: Initialize Git configuration
run: |
git config user.name docs-sched-rebuild
git config user.email [email protected]
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: html-build-artifact
- name: Copy HTML directories
run: |
ls -asl
for i in `ls -d *`
do
echo "Git adding ${i}"
git add "${i}"
done
- name: Commit changes to the GitHub Pages branch
run: |
git status
if git commit -m 'Pushing changes to GitHub Pages.'; then
git push -f
else
echo "Nothing changed."
fi