fix gh page workflow #423
Workflow file for this run
This file contains hidden or 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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
deploy: | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip | |
- name: Install the package and its dependencies | |
run: | | |
python -m pip install . | |
- name: Install the docs-build dependencies | |
run: | | |
sudo apt-get install -y pandoc | |
python -m pip install sphinx | |
python -m pip install sphinx-autodoc-typehints | |
python -m pip install nbsphinx | |
python -m pip install pydata-sphinx-theme | |
- name: Build the docs | |
run: | | |
cd docs | |
make html | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/MonashSmartStructures/ops-grillage.git --single localbranch --branch gh-pages | |
cp -r docs/build/html/* localbranch/ | |
cd localbranch | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git branch --all | |
git add . | |
git commit -m "Update documentation" -a || true | |
# The above command will fail if no changes were present, so we ignore | |
# the return code. | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: localbranch | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Build and Commit | |
# uses: sphinx-notes/pages@master | |
# with: | |
# target_branch: gh-pages-test | |
# repository_path: . | |
# documentation_path: docs/source | |
# install_requirements: true | |
# - name: Deploy | |
# uses: s0/git-publish-subdir-action@develop | |
# env: | |
# REPO: self | |
# BRANCH: gh-pages | |
# FOLDER: docs/build/html | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |