|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + # Optional: manual trigger |
| 8 | + workflow_dispatch: |
7 | 9 |
|
8 | 10 | jobs: |
9 | | - build-docs: |
| 11 | + deploy-docs: |
10 | 12 | runs-on: ubuntu-latest |
11 | 13 | permissions: |
12 | 14 | contents: write |
13 | 15 |
|
14 | 16 | steps: |
15 | | - - name: Run a one-line script |
16 | | - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." |
17 | | - - name: checkout |
18 | | - uses: actions/checkout@v4 |
19 | | - with: |
20 | | - fetch-depth: 0 |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
21 | 21 |
|
22 | | - - name: Setup Micromamba ${{ matrix.python-version }} |
23 | | - uses: mamba-org/setup-micromamba@v2.0.1 |
24 | | - with: |
25 | | - environment-name: TEST |
26 | | - init-shell: bash |
27 | | - create-args: >- |
28 | | - python=3 pip |
29 | | - --file requirements-dev.txt |
30 | | - --channel conda-forge |
| 22 | + - name: Setup Micromamba |
| 23 | + uses: mamba-org/setup-micromamba@v2 |
| 24 | + with: |
| 25 | + environment-file: environment.yml |
| 26 | + init-shell: bash |
| 27 | + condarc: | |
| 28 | + channels: |
| 29 | + - conda-forge |
| 30 | + channel_priority: strict |
| 31 | + cache-environment: true |
31 | 32 |
|
32 | | - - name: Install seagliderOG1 |
33 | | - shell: bash -l {0} |
34 | | - run: | |
35 | | - python -m pip install -e . --no-deps --force-reinstall |
| 33 | + - name: Install package (editable) |
| 34 | + shell: bash -l {0} |
| 35 | + run: | |
| 36 | + micromamba run -n TEST python -m pip install --upgrade pip |
| 37 | + micromamba run -n TEST python -m pip install -e . --no-deps --force-reinstall |
36 | 38 |
|
37 | | - - name: Build documentation |
38 | | - shell: bash -l {0} |
39 | | - run: | |
40 | | - set -e |
41 | | - jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True |
42 | | - mv notebooks/*output.ipynb docs/source/ |
43 | | - pushd docs |
44 | | - make clean html |
45 | | - popd |
| 39 | + - name: Build documentation |
| 40 | + shell: bash -l {0} |
| 41 | + run: | |
| 42 | + set -e |
| 43 | + micromamba run -n TEST jupyter nbconvert --to notebook --execute notebooks/demo.ipynb --output=demo-output.ipynb --ExecutePreprocessor.allow_errors=True |
| 44 | + mv notebooks/*output.ipynb docs/source/ |
| 45 | + pushd docs |
| 46 | + micromamba run -n TEST make clean html |
| 47 | + popd |
46 | 48 |
|
47 | | - - name: Deploy |
48 | | - uses: peaceiris/actions-gh-pages@v4 |
49 | | - with: |
50 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
51 | | - publish_dir: docs/build/html |
| 49 | + - name: Deploy to GitHub Pages |
| 50 | + uses: peaceiris/actions-gh-pages@v4 |
| 51 | + with: |
| 52 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + publish_dir: docs/build/html |
0 commit comments