Skip to content

Merge pull request #21 from WCRP-CORDEX/pre-commit-ci-update-config #56

Merge pull request #21 from WCRP-CORDEX/pre-commit-ci-update-config

Merge pull request #21 from WCRP-CORDEX/pre-commit-ci-update-config #56

Workflow file for this run

name: deploy
on:
# Trigger the workflow on push to main branch
push:
branches:
- main
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [macos-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "CONDA_ENV_FILE=environment.yml" >> $GITHUB_ENV
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-downloads-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
micromamba-version: 'latest'
environment-file: environment.yml
extra-specs: |
python=${{ matrix.python-version }}
# Build the book
- name: Build the book
env:
ESGF_USER: ${{ secrets.ESGF_USER }}
ESGF_PASSWORD: ${{ secrets.ESGF_PASSWORD }}
run: |
jupyter-book build tutorials
# Deploy the book's HTML to gh-pages branch
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: tutorials/_build/html
publish_branch: gh-pages