Skip to content

Full Build & Deploy of Docs #2092

Full Build & Deploy of Docs

Full Build & Deploy of Docs #2092

# As much as possible, this file should be kept in sync with
# https://github.com/napari/napari/blob/main/.github/workflows/build_docs.yml
#
# Note this workflow is also triggered by
# https://github.com/napari/napari/blob/main/.github/workflows/deploy_docs.yml when a
# commit to `main` occurs in `napari/napari`
name: Full Build & Deploy of Docs
# this does a full build of the docs for deployment
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
inputs:
target_directory:
description: 'The directory to deploy the docs to'
required: true
default: 'dev'
napari_ref:
description: 'The napari/napari ref to build the docs against'
required: true
default: 'main'
docs_ref:
description: 'The napari/docs ref to build'
required: false
default: ''
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-upload:
name: Build & Upload Artifact
uses: napari/shared-workflows/.github/workflows/build_docs.yml@main
secrets: inherit
with:
main-repo: "napari/napari"
main-ref: ${{ github.event.inputs.napari_ref || 'main' }}
docs-repo: ${{ github.repository }}
docs-ref: ${{ github.event.inputs.docs_ref || github.ref }}
make_target: "html"
deploy:
name: Download & Deploy Artifact
needs: build-and-upload
runs-on: ubuntu-latest
# Working directory: '/home/runner/work/docs/docs'
steps:
- name: Download artifact
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: html
# Downloads to '/home/runner/work/docs/docs/html'
path: html
- name: Deploy Docs
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main'))
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: napari/napari.github.io
publish_dir: ./html
publish_branch: gh-pages
destination_dir: ${{ github.event.inputs.target_directory || 'dev' }}
cname: napari.org