Merge pull request #624 from fermiPy/MiltosMichailidis-patch-1 #39
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: Docs | |
on: [push, release] | |
jobs: | |
notebooks: | |
name: "Build the notebooks for the docs" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
#- name: Set up Python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: 3.9 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: fermiPy/fermipy-extra | |
path: fermipy-extra | |
- name: Setup environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: fermipy | |
auto-activate-base: false | |
architecture: "x64" | |
miniforge-version: latest | |
python-version: 3.9 | |
environment-file: environment.yml | |
- name: Install additional packages | |
shell: bash -l {0} | |
run: | | |
mamba install -n fermipy -c conda-forge jupytext nbconvert jupyterthemes notebook ipykernel | |
pip install -e . | |
- name: Execute the notebooks | |
shell: bash -l {0} | |
run: | | |
# Make sure we fail in case of error | |
set -e | |
ls fermipy-extra/notebooks | |
rm fermipy-extra/notebooks/index.ipynb | |
rm fermipy-extra/notebooks/dSphs.ipynb | |
jupytext --execute fermipy-extra/notebooks/*.ipynb | |
mv fermipy-extra/notebooks/*.ipynb docs/notebooks/ | |
ls docs/notebooks | |
# - name: Create function gallery | |
# #shell: bash -l {0} | |
# run: | | |
# # move to the scripts directory | |
# cd scripts | |
# # now generate the function docs | |
# python generate_func_docs.py | |
# cd .. | |
# ls docs/notebooks | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: notebooks-for-${{ github.sha }} | |
path: docs/notebooks | |
- name: Sleep for 5 min | |
uses: juliangruber/sleep-action@v1 | |
with: | |
time: 5m | |
- name: Trigger RTDs build | |
uses: dfm/rtds-action@main | |
with: | |
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} | |
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} | |
commit_ref: ${{ github.ref }} |