.github/workflows/deploy.yml #15
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
on: | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
env: | |
DOCKER_IMAGE: 'registry.gitlab.eox.at/esa/vires_vre_ops/vre-swarm-notebook:0.10.17' | |
jobs: | |
pre-commit: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: --hook-stage manual --all-files | |
book: | |
needs: pre-commit | |
name: Build Jupyter Book (Production) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pull docker image | |
run: | | |
echo ${{ secrets.EOX_REGISTRY_PASSWORD }} | docker login -u ${{ secrets.EOX_REGISTRY_USER }} --password-stdin registry.gitlab.eox.at | |
docker pull ${{ env.DOCKER_IMAGE }} | |
- uses: actions/checkout@v4 | |
- name: Execute notebooks using nbmake | |
run: | | |
docker run -v $GITHUB_WORKSPACE:/home/jovyan -u root \ | |
-e VIRES_TOKEN=${{ secrets.VIRES_TOKEN }} \ | |
${{ env.DOCKER_IMAGE }} \ | |
bash -c \ | |
' | |
export CDF_LIB=/opt/conda/lib && \ | |
viresclient set_token https://vires.services/ows $VIRES_TOKEN && \ | |
viresclient set_default_server https://vires.services/ows && \ | |
pip install nbmake pytest-xdist && \ | |
pytest --numprocesses 2 --nbmake --overwrite \ | |
notebooks/*.ipynb \ | |
--deselect=notebooks/04c1_Geomag-Ground-Data-FTP.ipynb | |
' | |
- name: Build book | |
if: always() | |
run: | | |
docker run -v $GITHUB_WORKSPACE:/home/jovyan -u root ${{ env.DOCKER_IMAGE }} \ | |
bash -c \ | |
' | |
pip install jupyter-book==0.12.3 && \ | |
jupyter-book build --config _config-ci.yml . | |
' | |
- name: Deploy preview to Netlify | |
if: always() | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './_build/html' | |
production-deploy: false | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy from GitHub Actions (master)" | |
github-deployment-environment: production-preview | |
github-deployment-description: "jupyter-book production preview" | |
alias: preview-master | |
enable-pull-request-comment: true | |
enable-commit-comment: true | |
overwrites-pull-request-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_API_ID }} |