Skip to content

Commit d221694

Browse files
committed
WIP
1 parent 9c367ae commit d221694

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

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

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
contents: read
1717
deployments: write
1818
pull-requests: write
19+
actions: write
1920
env:
2021
RUSTC_WRAPPER: /usr/bin/sccache
2122
CARGO_INCREMENTAL: 0
@@ -47,17 +48,19 @@ jobs:
4748
rustc --version
4849
4950
- name: ✂ Replace template in <head> of index.html
51+
if: github.ref != 'refs/heads/master'
52+
env:
53+
INDEX_HTML_HEAD_REPLACEMENT: ""
5054
run: |
5155
# 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=""
5356
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
5457
5558
- name: 🌐 Build Graphite web code
5659
env:
5760
NODE_ENV: production
5861
run: |
5962
cd frontend
60-
mold -run npm run build
63+
mold -run npm run
6164
6265
- name: 📤 Publish to Cloudflare Pages
6366
id: cloudflare
@@ -91,6 +94,49 @@ jobs:
9194
run: |
9295
mold -run cargo test --all-features --workspace
9396
97+
- name: 📃 Generate code documentation info for website
98+
# if: github.ref == 'refs/heads/master'
99+
run: |
100+
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
101+
mkdir -p artifacts-generated
102+
mv hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
103+
104+
- name: 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
105+
id: cache-website-code-docs
106+
uses: actions/cache/restore@v3
107+
with:
108+
path: artifacts
109+
key: website-code-docs
110+
111+
- name: 🔍 Check if auto-generated code docs artifacts changed
112+
id: website-code-docs-changed
113+
run: |
114+
if ! diff --brief --recursive artifacts-generated artifacts; then
115+
echo "Auto-generated code docs artifacts have changed."
116+
rm -rf artifacts
117+
mv artifacts-generated artifacts
118+
echo "changed=true" >> $GITHUB_OUTPUT
119+
else
120+
echo "Auto-generated code docs artifacts have not changed."
121+
rm -rf artifacts
122+
rm -rf artifacts-generated
123+
fi
124+
125+
- name: 💾 Save cache of auto-generated code docs artifacts
126+
if: steps.website-code-docs-changed.outputs.changed == 'true'
127+
uses: actions/cache/save@v3
128+
with:
129+
path: artifacts
130+
key: ${{ steps.cache-website-code-docs.outputs.cache-primary-key }}
131+
132+
- name: ♻️ Trigger website rebuild if the auto-generated code docs artifacts have changed
133+
if: steps.website-code-docs-changed.outputs.changed == 'true'
134+
env:
135+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
run: |
137+
rm -rf artifacts
138+
gh workflow run website.yml --ref master
139+
94140
# miri:
95141
# runs-on: self-hosted
96142

.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

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