Skip to content

Workflow file for this run

name: Build and Deploy Docs
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
# Only allow one docs build at a time so that overlapping stale builds will get
# cancelled automatically.
concurrency:
group: deploy_docs
cancel-in-progress: true
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Clone docs repo
uses: actions/checkout@main
with:
path: docs # place in a named directory
- name: Clone main repo
uses: actions/checkout@main
with:
path: napari-repo
ref: main
repository: napari/napari
# ensure version metadata is proper
fetch-depth: 0
- name: Copy examples to docs folder
run: |
cp -R napari-repo/examples docs
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: tlambert03/setup-qt-libs@v1
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "napari-repo/[all]" -c "napari-repo/resources/constraints/constraints_py3.9.txt"
- name: Testing
run: |
python -c 'import napari; print(napari.__version__)'
python -c 'import napari.layers; print(napari.layers.__doc__)'
- name: Build Docs
uses: aganders3/headless-gui@v1
env:
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
with:
# the napari-docs repo is cloned into a docs/ folder, hence the
# invocation below. Locally, you should simply run make docs
run: make -C docs docs GALLERY_PATH=../examples/
- name: Debug folders
run: |
echo "pwd"
pwd
echo "ls -l docs"
ls -l docs
echo "ls -l docs/docs"
ls -l docs/docs
echo "ls -l docs/docs/_build"
ls -l docs/docs/_build
- name: Copy permanent files
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'docs/docs/_build/index.html'
destination_repo: 'melissawm/napari.github.io'
destination_folder: 'stable'
destination_branch: 'gh-pages'
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: melissawm/napari.github.io
publish_dir: docs/docs/_build
publish_branch: gh-pages
destination_dir: dev
cname: napari.org