Merge pull request #150 from acerbilab/dependabot/github_actions/acti… #20
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
# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml | |
name: docs | |
# execute this workflow automatically when a we push to main | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
path: gh-pages | |
ref: gh-pages | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
cd ./main | |
python -m pip install .[dev] | |
- name: Make the Sphinx docs | |
run: | | |
cd ./main/docsrc | |
make clean | |
make github | |
- name: Commit changes to docs | |
run: | | |
cd ./gh-pages | |
cp -R ../main/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 |