-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 2.45 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 }}