Skip to content

enh: add a CITATION.cff file #95

enh: add a CITATION.cff file

enh: add a CITATION.cff file #95

Workflow file for this run

name: deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- main
pull_request:
branches:
- main
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- name: Prepare apt cache directories
run: |
sudo mkdir -p /var/lib/apt/lists/partial /var/cache/apt/archives/partial
sudo chown -R "$USER" /var/lib/apt/lists /var/cache/apt/archives
- name: Cache apt packages
uses: actions/cache@v4
with:
path: |
/var/lib/apt/lists
/var/cache/apt/archives
key: ${{ runner.os }}-apt-v1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
curl \
bzip2 \
ca-certificates \
dvipng \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-latex-extra \
cm-super
- name: Restore apt cache permissions
if: always()
run: sudo chown -R "$USER" /var/lib/apt/lists /var/cache/apt/archives
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 200
fetch-tags: true
ref: ${{ github.ref }}
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.55.0
run-install: false
- run: pixi lock --check
- name: Install project environment
run: pixi install --locked
- name: Cache tutorial data
id: cache-tutorial-data
uses: actions/cache@v4
with:
path: data/dwi_full_brainmask.h5
key: ${{ runner.os }}-tutorial-data-v1
- name: Download tutorial data
if: steps.cache-tutorial-data.outputs.cache-hit != 'true'
run: |
set -xeuo pipefail
data_dir="${{ github.workspace }}/data"
data_file="$data_dir/dwi_full_brainmask.h5"
mkdir -p "$data_dir"
curl -L \
https://files.osf.io/v1/resources/8k95s/providers/osfstorage/68e5464a451cf9cf1fc51a53 \
--output "$data_file"
test -s "$data_file"
- name: Configure tutorial data
run: |
data_file="${{ github.workspace }}/data/dwi_full_brainmask.h5"
test -s "$data_file"
echo "NIPREPS_TUTORIAL_DATA=$data_file" >> "$GITHUB_ENV"
# Build the page
- name: Build the book
run: pixi run build-book
# Push the book's HTML to github-pages
- name: GitHub Pages action
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
- name: Generate tutorial notebooks
run: |
git pull
pixi run python -m jupytext docs/tutorial/intro.md --to ipynb -o docs/notebook/01-intro.ipynb
pixi run python -m jupytext docs/tutorial/data.md --to ipynb -o docs/notebook/02-data.ipynb
pixi run python -m jupytext docs/tutorial/models.md --to ipynb -o docs/notebook/03-models.ipynb
pixi run python -m jupytext docs/tutorial/registration.md --to ipynb -o docs/notebook/04-registration.ipynb
pixi run python -m jupytext docs/tutorial/solution.md --to ipynb -o docs/notebook/05-solution.ipynb
- name: Commit updated notebooks
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
if [[ -n "$(git status --porcelain docs/notebook/*.ipynb)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs/notebook/*.ipynb
git commit -m "Update tutorial notebooks"
git push
fi