Deploy documentation with GitHub Pages dependencies preinstalled #1
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
# Based on https://github.com/executablebooks/cookiecutter-jupyter-book/blob/main/.github/workflows/tests.yml | |
name: tests | |
on: | |
# Trigger the workflow on push or pull request on main branch | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
# Run cron job every month, https://crontab.guru/every-month | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
# This job tests that the CC works | |
test-cc-and-jb-build: | |
# prevent this action from running on forks | |
#if: github.repository == 'abinit/abipy' | |
defaults: | |
run: | |
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile | |
runs-on: ubuntu-latest | |
#env: | |
# PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
# Install dependencies | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Abinit, AbiPy and dependencies | |
run: | | |
conda create -n abipy python=${{ matrix.config.python }} --yes | |
conda activate abipy | |
conda install abinit -c conda-forge --yes | |
mpirun -n 1 abinit --version | |
mpirun -n 1 abinit --build | |
pip install --editable . | |
mkdir -p $HOME/.abinit/abipy/ | |
#cp abipy/data/managers/travis_manager.yml $HOME/.abinit/abipy/manager.yml | |
#cp abipy/data/managers/simple_scheduler.yml $HOME/.abinit/abipy/scheduler.yml | |
jupyter-book build abipy_book --builder linkcheck | |
# Build the example book | |
#- name: Build book | |
# run: | | |
# jupyter-book build my_book/my_book/ | |
## Upload the book's HTML as an artifact | |
#- name: Upload artifact | |
# uses: actions/upload-pages-artifact@v2 | |
# with: | |
# path: "my_book/my_book/_build/html" | |
# Deploy the book's HTML to GitHub Pages | |
#- name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v2 |