GitHub Pages #116
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-20.04 | |
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.9 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super | |
conda install pip setuptools | |
conda install flake8 pytest-cov | |
conda install -c conda-forge numpy scipy sympy | |
conda update -c conda-forge numpy scipy sympy | |
conda install -c conda-forge gwsurrogate python-lalsimulation sxs | |
conda install -c conda-forge matplotlib "basemap>=1.3.6" | |
python -m pip install nrsur7dq2 | |
conda install -c conda-forge ipykernel jupyter ipython | |
conda install -c conda-forge ipython_genutils jinja2 nbsphinx numpydoc pandoc pygments sphinx sphinx_rtd_theme | |
- 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: . |