Repository navigation
104 lines (99 loc) · 3.01 KB
/
Copy pathdocs.yaml
File metadata and controls
104 lines (99 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: 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]+'
workflow_dispatch:
inputs:
target:
description: 'Site to build and deploy, or dry-run'
type: choice
options:
- dev
- main
- dryrun
required: true
default: dryrun
version:
description: 'Version tag X.X.X (required if target is main)'
required: false
schedule:
- cron: '0 20 * * SUN'
defaults:
run:
shell: bash -e {0}
env:
PYTHON_VERSION: "3.11"
DESC: "Documentation build"
jobs:
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@v0
build_docs:
name: Build Documentation
needs: [pixi_lock]
runs-on: 'ubuntu-latest'
timeout-minutes: 120
outputs:
tag: ${{ steps.vars.outputs.tag }}
env:
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ inputs.version }}
steps:
- name: Validate version
if: ${{ inputs.target == 'main' }}
run: |
if [[ -z "$VERSION" || ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ 'version' is required and must match format X.X.X (e.g. 0.11.1) when target is 'main'"
exit 1
fi
- uses: holoviz-dev/holoviz_tasks/pixi_install@v0
with:
environments: docs
- name: Build documentation
run: pixi run -e docs docs-build
- uses: actions/upload-artifact@v7
if: always()
with:
name: docs
if-no-files-found: error
path: site/builtdocs
- name: report failure
if: failure()
run: cat /tmp/sphinx-*.log | tail -n 100
docs_publish:
name: Publish Documentation
runs-on: "ubuntu-latest"
needs: [build_docs]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/download-artifact@v8
with:
name: docs
path: site/builtdocs/
- name: Set and echo git ref
id: vars
run: |
echo "Deploying from ref ${GITHUB_REF#refs/*/}"
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- uses: holoviz-dev/holoviz_tasks/docs-publish@v0
with:
s3-url: s3://nbsite.holoviz.org
s3-cloudfront-id: E2L666PQUSAVUF
s3-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
version: ${{ inputs.version }}
build-path: ./site/builtdocs/
switcher-path: ./site/builtdocs/_static/switcher.json
sitemap-path: ./site/builtdocs/_nbsite_versioned/sitemap.xml
robots-path: ./site/builtdocs/_nbsite_versioned/robots.txt
error-404-path: ./site/builtdocs/_nbsite_versioned/404.html