Skip to content

Commit 1a25617

Browse files
committed
Update website deployment CI script to output auto-generated code docs artifacts
1 parent e025103 commit 1a25617

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

.github/workflows/website.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
paths:
1111
- website/**
12+
workflow_dispatch: {}
1213
env:
1314
CARGO_TERM_COLOR: always
1415
INDEX_HTML_HEAD_INCLUSION: <script defer data-domain="graphite.rs" data-api="/visit/event" src="/visit/script.hash.js"></script>
@@ -30,6 +31,14 @@ jobs:
3031
with:
3132
3233

34+
- name: 🔍 Check if `website/other` directory changed
35+
uses: dorny/paths-filter@v3
36+
id: changes
37+
with:
38+
filters: |
39+
website-other:
40+
- "website/other/**"
41+
3342
- name: ✂ Replace template in <head> of index.html
3443
run: |
3544
# Remove the INDEX_HTML_HEAD_INCLUSION environment variable for build links (not master deploys)
@@ -43,16 +52,8 @@ jobs:
4352
npm run install-fonts
4453
zola --config config.toml build --minify
4554
46-
- name: 🔍 Check if `website/other` directory changed
47-
uses: dorny/paths-filter@v3
48-
id: changes
49-
with:
50-
filters: |
51-
other:
52-
- "website/other/**"
53-
5455
- name: 💿 Restore cache of `website/other/dist` directory, if available and `website/other` didn't change
55-
if: steps.changes.outputs.other != 'true'
56+
if: steps.changes.outputs.website-other != 'true'
5657
id: cache-website-other-dist
5758
uses: actions/cache/restore@v3
5859
with:
@@ -80,8 +81,32 @@ jobs:
8081

8182
- name: 🚚 Move `website/other/dist` contents to `website/public`
8283
run: |
84+
mkdir -p website/public
8385
mv website/other/dist/* website/public
8486
87+
- name: 💿 Obtain cache of auto-generated code docs artifacts
88+
id: cache-website-code-docs
89+
uses: actions/cache/restore@v3
90+
with:
91+
path: artifacts
92+
key: website-code-docs
93+
94+
- name: 📁 Fallback in case auto-generated code docs artifacts weren't cached
95+
if: steps.cache-website-code-docs.outputs.cache-hit != 'true'
96+
run: |
97+
echo "🦀 Initial system version of Rust:"
98+
rustc --version
99+
rustup update stable
100+
echo "🦀 Latest updated version of Rust:"
101+
rustc --version
102+
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
103+
mkdir artifacts
104+
mv hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
105+
106+
- name: 🚚 Move `artifacts` contents to `website/public`
107+
run: |
108+
mv artifacts/* website/public
109+
85110
- name: 📤 Publish to Cloudflare Pages
86111
id: cloudflare
87112
uses: cloudflare/pages-action@1

0 commit comments

Comments
 (0)