Merge branch 'DUNE:develop' into master #2
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
# Workflow that deploy docs | |
name: Docs | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
# Semantic version range syntax or exact version of a Python version | |
python-version: '3.8' | |
- uses: ammaraskar/sphinx-action@master | |
with: | |
docs-folder: "docs/" | |
pre-build-command: "sed -i 's/from ROOT/#from ROOT/g' cli/dumpTree.py; sed -i 's/from larndsim.cuda_dict/#from larndsim.cuda_dict/g' cli/simulate_pixels.py; sed -i 's/@cuda/#@cuda/g' larndsim/*.py; sed -i 's/import cupy/#import cupy/g' larndsim/light_sim.py; sed -i 's/import cupy/#import cupy/g' larndsim/fee.py; sed -i 's/import cupy/#import cupy/g' cli/simulate_pixels.py; sed -i 's/from cupy/#from cupy/g' cli/simulate_pixels.py; sed -i 's/from larpix/#from larpix/g' larndsim/fee.py" | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: DocumentationHTML | |
path: docs/build/html/ | |
# Publish built docs to gh-pages branch. | |
# =============================== | |
- name: Commit documentation changes | |
run: | | |
git clone https://github.com/DUNE/larnd-sim.git --branch gh-pages --single-branch gh-pages | |
cp -r docs/build/html/* gh-pages/ | |
cd gh-pages | |
touch .nojekyll | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update documentation" -a || true | |
# The above command will fail if no changes were present, so we ignore | |
# that. | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
directory: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |