Merge pull request #481 from niaid/fix/update_brt_version #725
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: Github Pages Documentation | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- dev | |
- main | |
env: | |
HEDWIG_ENV: dev | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
name: Docs | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install -r docs/requirements.txt | |
- name: Build Sphinx Documentation | |
run: | | |
make -C docs html | |
- name: Upload documentation | |
if: github.event_name == 'push' | |
uses: actions/upload-artifact@v1 | |
with: | |
name: sphinx-docs | |
path: docs/_build/html | |
- name: Update gh-pages | |
if: (github.ref == 'refs/heads/dev') || (github.ref == 'refs/heads/main') | |
run: | | |
rm docs/_build/html/.buildinfo | |
touch docs/_build/html/.nojekyll | |
git update-ref refs/heads/${TARGET_BRANCH} origin/${TARGET_BRANCH} | |
./.github/workflows/update-gh-pages.sh docs/_build/html | |
repo_uri="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git push $repo_uri ${TARGET_BRANCH} | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
TARGET_BRANCH: "gh-pages" |