Skip to content

Add demos of swarm packages #32

Add demos of swarm packages

Add demos of swarm packages #32

Workflow file for this run

on:
pull_request:
branches:
- staging
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 (Staging)
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 }} \
-e VIRES_TOKEN_STAGING=${{ secrets.VIRES_TOKEN_STAGING }} \
-e VIRES_TOKEN_STAGING_DISC=${{ secrets.VIRES_TOKEN_STAGINGDISC}} \
${{ env.DOCKER_IMAGE }} \
bash -c \
'
export CDF_LIB=/opt/conda/lib && \
pip install --upgrade 'git+https://github.com/ESA-VirES/VirES-Python-Client@staging#egg=viresclient' && \
viresclient set_token https://vires.services/ows $VIRES_TOKEN && \
viresclient set_token https://staging.vires.services/ows $VIRES_TOKEN_STAGING && \
viresclient set_token https://staging.viresdisc.vires.services/ows $VIRES_TOKEN_STAGING_DISC && \
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-staging.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 (staging)"
github-deployment-environment: staging
github-deployment-description: "jupyter-book staging preview"
alias: preview-staging
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 }}