Merge pull request #1782 from pace-neutrons/docify2024 #420
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: Horace user documentation update | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
doc_root: $GITHUB_WORKSPACE/documentation/user_docs | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Update dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel | |
python -m pip install -r ${{ env.doc_root }}/requirements.txt | |
- name: Build and Commit | |
run: | | |
tmp_dir=$(mktemp -d -t pages-XXXXXXXXXX) | |
sphinx-build -b html ${{ env.doc_root }}/docs $tmp_dir | |
rm -rf $tmp_dir/.doctrees | |
cd $GITHUB_WORKSPACE | |
git checkout --force gh-pages | |
rm -rf unstable | |
cp -rpav $tmp_dir unstable | |
git add unstable | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Actions" | |
git commit --allow-empty -m "Add unstable changes for $GITHUB_SHA" | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages |