Skip to content

Commit 35c5d6e

Browse files
Optimize Quarto build: remove R, cache Python docs, disable execution, exclude _source, scope lightbox
- Remove unused R setup from all 3 deploy workflows (0 R code blocks exist) - Cache Python API docs by validmind-library SHA (skip Poetry+install on cache hit) - Cache Quarto _site/_freeze/.quarto output with config-aware cache keys - Add execute: false + freeze: true globally to prevent accidental notebook execution - Add render: ['!_source/'] to exclude cloned repos from Quarto project scan - Disable lightbox globally, enable only on 21 pages that actually use it Co-authored-by: amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c6ed2-7b81-763a-a6f8-0df84b9b6531
1 parent c98fb3d commit 35c5d6e

7 files changed

Lines changed: 84 additions & 7 deletions

File tree

.github/workflows/deploy-docs-prod.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,25 @@ jobs:
5959
with:
6060
version: ${{ vars.QUARTO_VERSION }}
6161

62-
- name: Setup R environment
63-
uses: ./.github/actions/setup-r
62+
- name: Get validmind-library SHA
63+
id: lib-sha
64+
run: echo "sha=$(git -C site/_source/validmind-library rev-parse HEAD)" >> $GITHUB_OUTPUT
65+
66+
- name: Cache Python library docs
67+
id: cache-python-docs
68+
uses: actions/cache@v4
69+
with:
70+
path: site/validmind
71+
key: python-docs-${{ steps.lib-sha.outputs.sha }}
6472

6573
- name: Install Poetry
74+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
6675
run: |
6776
curl -sSL https://install.python-poetry.org | python3 -
6877
echo "$HOME/.local/bin" >> $GITHUB_PATH
6978
7079
- name: Generate Python library docs
80+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
7181
run: |
7282
cd site/_source/validmind-library
7383
make install && make quarto-docs
@@ -84,6 +94,17 @@ jobs:
8494
cp -r site/_source/release-notes/releases site
8595
rm -f site/releases/backend-releases.qmd site/releases/cmvm-releases.qmd
8696
97+
- name: Cache Quarto site output
98+
uses: actions/cache@v4
99+
with:
100+
path: |
101+
site/_site
102+
site/_freeze
103+
site/.quarto
104+
key: quarto-site-production-${{ hashFiles('site/_quarto.yml', 'site/_quarto-production.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-${{ github.sha }}
105+
restore-keys: |
106+
quarto-site-production-${{ hashFiles('site/_quarto.yml', 'site/_quarto-production.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-
107+
87108
- name: Render prod docs site
88109
run: |
89110
cd site

.github/workflows/deploy-docs-staging.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,25 @@ jobs:
5959
with:
6060
version: ${{ vars.QUARTO_VERSION }}
6161

62-
- name: Setup R environment
63-
uses: ./.github/actions/setup-r
62+
- name: Get validmind-library SHA
63+
id: lib-sha
64+
run: echo "sha=$(git -C site/_source/validmind-library rev-parse HEAD)" >> $GITHUB_OUTPUT
65+
66+
- name: Cache Python library docs
67+
id: cache-python-docs
68+
uses: actions/cache@v4
69+
with:
70+
path: site/validmind
71+
key: python-docs-${{ steps.lib-sha.outputs.sha }}
6472

6573
- name: Install Poetry
74+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
6675
run: |
6776
curl -sSL https://install.python-poetry.org | python3 -
6877
echo "$HOME/.local/bin" >> $GITHUB_PATH
6978
7079
- name: Generate Python library docs
80+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
7181
run: |
7282
cd site/_source/validmind-library
7383
make install && make quarto-docs
@@ -84,6 +94,17 @@ jobs:
8494
cp -r site/_source/release-notes/releases site
8595
rm -f site/releases/backend-releases.qmd site/releases/cmvm-releases.qmd
8696
97+
- name: Cache Quarto site output
98+
uses: actions/cache@v4
99+
with:
100+
path: |
101+
site/_site
102+
site/_freeze
103+
site/.quarto
104+
key: quarto-site-staging-${{ hashFiles('site/_quarto.yml', 'site/_quarto-staging.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-${{ github.sha }}
105+
restore-keys: |
106+
quarto-site-staging-${{ hashFiles('site/_quarto.yml', 'site/_quarto-staging.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-
107+
87108
- name: Render staging docs site
88109
run: |
89110
cd site

.github/workflows/validate-docs-site.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,25 @@ jobs:
5959
with:
6060
version: ${{ vars.QUARTO_VERSION }}
6161

62-
- name: Setup R environment
63-
uses: ./.github/actions/setup-r
62+
- name: Get validmind-library SHA
63+
id: lib-sha
64+
run: echo "sha=$(git -C site/_source/validmind-library rev-parse HEAD)" >> $GITHUB_OUTPUT
65+
66+
- name: Cache Python library docs
67+
id: cache-python-docs
68+
uses: actions/cache@v4
69+
with:
70+
path: site/validmind
71+
key: python-docs-${{ steps.lib-sha.outputs.sha }}
6472

6573
- name: Install Poetry
74+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
6675
run: |
6776
curl -sSL https://install.python-poetry.org | python3 -
6877
echo "$HOME/.local/bin" >> $GITHUB_PATH
6978
7079
- name: Generate Python library docs
80+
if: steps.cache-python-docs.outputs.cache-hit != 'true'
7181
run: |
7282
cd site/_source/validmind-library
7383
make install && make quarto-docs
@@ -84,6 +94,17 @@ jobs:
8494
cp -r site/_source/release-notes/releases site
8595
rm -f site/releases/backend-releases.qmd site/releases/cmvm-releases.qmd
8696
97+
- name: Cache Quarto site output
98+
uses: actions/cache@v4
99+
with:
100+
path: |
101+
site/_site
102+
site/_freeze
103+
site/.quarto
104+
key: quarto-site-development-${{ hashFiles('site/_quarto.yml', 'site/_quarto-development.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-${{ github.sha }}
105+
restore-keys: |
106+
quarto-site-development-${{ hashFiles('site/_quarto.yml', 'site/_quarto-development.yml', 'site/theme.scss', 'site/styles.css', 'site/**/_sidebar.yaml', 'site/**/_sidebar.yml', 'site/_extensions/**') }}-
107+
87108
- name: Render demo docs site
88109
run: |
89110
cd site

site/_quarto.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
project:
66
type: website
7+
render:
8+
- "**"
9+
- "!_source/**"
710

811
metadata-files:
912
# - _drafts.yaml
@@ -267,8 +270,12 @@ format:
267270
link-external-icon: true
268271
callout-appearance: simple
269272
link-external-filter: '^https:\/\/(docs\.validmind\.ai|docs-staging\.validmind\.ai|docs-demo\.vm\.validmind\.ai)\/.*'
270-
lightbox: true
273+
lightbox: false
271274

272275
filters:
273276
- tachyons
274277
- preview
278+
279+
execute:
280+
enabled: false
281+
freeze: true

site/about/contributing/style-guide/conventions.qmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# SPDX-License-Identifier: AGPL-3.0 AND ValidMind Commercial
55
title: "Conventions"
66
date: last-modified
7+
format:
8+
html:
9+
lightbox: true
710
---
811

912
A message can only make an impact when it is received, so presentation is (almost) everything.

site/releases/2024/2024-dec-06/release-notes.qmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: "December 6, 2024"
33
date: 2024-12-06
4+
format:
5+
html:
6+
lightbox: true
47
aliases:
58
- /releases/2024-dec-06/release-notes.html
69
filters:

site/training/_metadata.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ format:
66
html:
77
page-layout: full
88
css: assets/training.css
9+
lightbox: true

0 commit comments

Comments
 (0)