Skip to content

Commit

Permalink
Update docs.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jun 21, 2024
1 parent d61068a commit 0239d54
Showing 1 changed file with 57 additions and 46 deletions.
103 changes: 57 additions & 46 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,77 @@
name: docs
nname: docs

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
inputs:
target:
description: 'Site to build and deploy'
description: "Site to build and deploy"
type: choice
options:
- dev
- main
- dryrun
- dev
- main
- dryrun
required: true
default: dryrun
schedule:
- cron: '0 18 * * SUN'
- cron: "0 18 * * SUN"

defaults:
run:
shell: bash -el {0}

env:
DISPLAY: ":99.0"

jobs:
build_docs:
name: Documentation
runs-on: 'ubuntu-latest'
timeout-minutes: 120
defaults:
run:
shell: bash -l {0}
env:
DESC: "Documentation build"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
MPLBACKEND: "Agg"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
DASK_DATAFRAME__QUERY_PLANNING: false
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

docs_build:
name: Build Documentation
needs: [pixi_lock]
runs-on: "macos-latest"
timeout-minutes: 180
outputs:
tag: ${{ steps.vars.outputs.tag }}
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
environments: docs
- name: Build documentation
run: pixi run -e docs docs-build
- uses: actions/upload-artifact@v4
if: always()
with:
name: Documentation
python-version: "3.10"
channels: pyviz,conda-forge,nodefaults
envs: "-o doc -o examples_extra"
cache: true
conda-update: true
name: docs
if-no-files-found: error
path: builtdocs
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: download data
run: |
conda activate test-environment
python download_data.py
- name: generate rst
run: |
conda activate test-environment
nbsite generate-rst --org holoviz --project-name geoviews
- name: build docs
run: |
conda activate test-environment
nbsite build --what=html --output=builtdocs --org holoviz --project-name geoviews

docs_publish:
name: Publish Documentation
runs-on: "ubuntu-latest"
needs: [docs_build]
steps:
- uses: actions/download-artifact@v4
with:
name: docs
path: builtdocs/
- name: Set output
id: vars
run: echo "tag=${{ needs.docs_build.outputs.tag }}" >> $GITHUB_OUTPUT
- name: Deploy dev
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
(github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
Expand All @@ -73,9 +84,9 @@ jobs:
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./builtdocs
cname: geoviews.org
cname: geoviews.holoviz.org
force_orphan: true

0 comments on commit 0239d54

Please sign in to comment.