GitHub Pages #140
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 | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
branches: | |
- main | |
- master | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- uses: s-weigand/setup-conda@v1 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super | |
conda install pip setuptools | |
conda install -c conda-forge --file requirements.txt --file optional_requirements.txt --file pages_requirements.txt | |
python -m pip install nrsur7dq2 | |
- name: Install gwmemory | |
run: | | |
pip install . | |
- name: List installed | |
run: | | |
conda list | |
- name: Run notebook | |
run: | | |
cd examples | |
jupyter nbconvert --to html --execute *.ipynb | |
cd .. | |
- name: Build documentation | |
run: | | |
cd docs | |
mv Makefile.gh_pages Makefile | |
cp ../examples/GWMemory.ipynb ./example.ipynb | |
cp ../examples/Comparison.ipynb ./comparison.ipynb | |
make clean | |
make html | |
cd ../ | |
touch _gh-pages/latest/html/.nojekyll | |
rm -r docs | |
mv _gh-pages/latest/html docs | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: . |