Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add multiversion-docs workflow to master branch to allow manual triggering #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/multiversion-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml
name: multiversion-docs

on:
workflow_dispatch:
# execute this workflow automatically when we push to master or dev
# push:
# branches:
# - master
# - dev

jobs:

build_docs:
runs-on: ubuntu-latest

steps:
- name: Checkout main
uses: actions/checkout@v3
with:
path: dev
fetch-depth: 0
fetch-tags: true

- name: Checkout gh-pages-dev
uses: actions/checkout@v3
with:
path: gh-pages-dev
ref: gh-pages-dev

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: "pip"

- name: Install dependencies
run: |
cd ./dev
python -m pip install .[docs]
- name: Create local branches
run: |
cd ./dev
git branch master remotes/origin/master
- name: Make the Sphinx docs
run: |
cd ./dev/docsrc
make clean
make github
- name: Commit changes to docs
run: |
cd ./gh-pages-dev
cp -R ../dev/docs/* ./
git config --local user.email ""
git config --local user.name "github-actions"
git add -A
if ! git diff-index --quiet HEAD; then
git commit -m "auto: Rebuild docs."
git push
else
echo No commit made because the docs have not changed.
fi
Loading