Skip to content

Commit c3d8ced

Browse files
committed
WIP
1 parent e025103 commit c3d8ced

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.github/workflows/build-dev-and-ci.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,61 @@ jobs:
4747
rustc --version
4848
4949
- name: ✂ Replace template in <head> of index.html
50+
if: github.ref != 'refs/heads/master'
51+
env:
52+
INDEX_HTML_HEAD_REPLACEMENT: ""
5053
run: |
5154
# Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys)
52-
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_REPLACEMENT=""
5355
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
5456
5557
- name: 🌐 Build Graphite web code
5658
env:
5759
NODE_ENV: production
5860
run: |
5961
cd frontend
60-
mold -run npm run build
62+
mold -run npm run
63+
64+
- name: 📃 Generate code documentation info for website
65+
# if: github.ref == 'refs/heads/master'
66+
run: |
67+
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
68+
mkdir -p artifacts-generated
69+
mv hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
70+
71+
- name: 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
72+
id: cache-website-code-docs
73+
uses: actions/cache/restore@v3
74+
with:
75+
path: artifacts
76+
key: website-code-docs-${{ runner.os }}
77+
78+
- name: 🔍 Check if auto-generated code docs artifacts changed
79+
id: website-code-docs-changed
80+
run: |
81+
if ! diff --brief --recursive artifacts-generated artifacts; then
82+
echo "Auto-generated code docs artifacts have changed."
83+
rm -rf artifacts
84+
mv artifacts-generated artifacts
85+
echo "changed=true" >> $GITHUB_OUTPUT
86+
else
87+
echo "Auto-generated code docs artifacts have not changed."
88+
rm -rf artifacts
89+
rm -rf artifacts-generated
90+
fi
91+
92+
- name: 💾 Save cache of auto-generated code docs artifacts
93+
if: steps.website-code-docs-changed.outputs.changed == 'true'
94+
uses: actions/cache/save@v3
95+
with:
96+
path: artifacts
97+
key: ${{ steps.cache-website-code-docs.outputs.cache-primary-key }}
98+
99+
- name: ♻️ Trigger website rebuild if the auto-generated code artifacts have changed
100+
if: steps.website-code-docs-changed.outputs.changed == 'true'
101+
env:
102+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
run: |
104+
gh workflow run website.yml --ref master
61105
62106
- name: 📤 Publish to Cloudflare Pages
63107
id: cloudflare

.github/workflows/comment-!build-commands.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ jobs:
7373
rustc --version
7474
7575
- name: ✂ Replace template in <head> of index.html
76+
env:
77+
INDEX_HTML_HEAD_REPLACEMENT: ""
7678
run: |
7779
# Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys)
78-
export INDEX_HTML_HEAD_REPLACEMENT=""
7980
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
8081
8182
- name: ⌨ Set build command based on comment

.github/workflows/website.yml

Lines changed: 1 addition & 0 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>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy