Try to deploy website #19
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: Deploy documentation with GitHub Pages dependencies preinstalled | ||
on: | ||
# Trigger the workflow on push or pull request on main branch | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
jobs: | ||
# This job tests that the CC works | ||
build: | ||
# prevent this action from running on forks | ||
if: github.repository == 'abinit/abipy_book' | ||
defaults: | ||
run: | ||
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
python: '3.12' | ||
runs-on: ${{ matrix.config.os }} | ||
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: Check out Abipy-book repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Set up Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
- name: Installing abinit from conda-forge and abipy with python=${{ matrix.config.python }} | ||
run: | | ||
pwd | ||
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 | ||
mkdir -p $HOME/.abinit/abipy/ | ||
cp abipy_book/data/gh_manager.yml $HOME/.abinit/abipy/manager.yml | ||
cp abipy_book/data/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml | ||
source install.sh | ||
- name: Build book | ||
run: | | ||
conda activate abipy | ||
jupyter-book build abipy_book | ||
#jupyter-book build abipy_book --builder linkcheck | ||
- name: Upload the book's HTML as an artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: abipy_book/_build/html | ||
# Deploy the book's HTML to GitHub Pages | ||
#- name: Deploy to GitHub Pages | ||
# id: deployment | ||
# uses: actions/deploy-pages@v2 | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 |