-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (78 loc) · 2.62 KB
/
deploy-docs.yaml
File metadata and controls
95 lines (78 loc) · 2.62 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
name: Deploy Docs Site
on:
workflow_dispatch:
inputs:
deploy_production:
description: "Deploy to production"
type: boolean
required: false
default: true
push:
branches: ["main"]
paths:
- "docs/**"
- "docs-site/**"
- ".github/workflows/deploy-docs.yaml"
pull_request:
paths:
- "docs/**"
- "docs-site/**"
- ".github/workflows/deploy-docs.yaml"
env:
# GCS bucket for static docs files (e.g., "everyrow-docs")
# Traefik needs to route everyrow.io/docs/* to this bucket
DOCS_BUCKET: ${{ vars.DOCS_BUCKET }}
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# --- Python setup for notebook conversion ---
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.12
# TODO: Re-enable after fixing notebook descriptions (see PR #91)
# - name: Validate notebook structure
# run: python docs-site/scripts/validate-notebooks.py
- name: Convert notebooks to HTML
run: uv run --group case-studies python docs-site/scripts/convert-notebooks.py
# --- Node.js setup for docs site ---
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
cache-dependency-path: "docs-site/pnpm-lock.yaml"
- name: Install dependencies
working-directory: ./docs-site
run: pnpm install --frozen-lockfile
- name: Build static site
working-directory: ./docs-site
run: pnpm build
- name: Check for broken links
run: python docs-site/scripts/check-links.py
- name: Log in to Google Cloud
if: ${{ github.ref == 'refs/heads/main' || inputs.deploy_production }}
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS_GLOBAL }}
- name: Set up Cloud SDK
if: ${{ github.ref == 'refs/heads/main' || inputs.deploy_production }}
uses: google-github-actions/setup-gcloud@v2
- name: Deploy docs site to GCS
if: ${{ github.ref == 'refs/heads/main' || inputs.deploy_production }}
working-directory: ./docs-site
run: |
gsutil -m -h "Cache-Control:max-age=300" rsync -r -d ./out/ gs://${{ env.DOCS_BUCKET }}