Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 21 additions & 33 deletions .github/workflows/export-excalidraw.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Export Excalidraw Diagrams
name: Export Diagrams
# Testing the triggering of this workflow:

on:
# Runs on any PR (any target branch) that touches .excalidraw files → validate only
# Runs on any PR (any target branch) that touches diagram source files → validate only
pull_request:
paths:
- '**/*.excalidraw'
- '**/*.puml'
- '**/*.plantuml'

# Runs when .excalidraw files land on main (PR merged) → export + commit
# Runs when diagram source files land on main (PR merged) → export + commit
push:
branches: [main]
paths:
- '**/*.excalidraw'
- '**/*.puml'
- '**/*.plantuml'

workflow_dispatch:

Expand All @@ -31,41 +35,25 @@ jobs:
with:
node-version: '20'

- name: Install excalidraw-brute-export-cli
# Local install so npx resolves playwright from the same node_modules,
# guaranteeing the Firefox cache path matches what the CLI expects
run: npm install excalidraw-brute-export-cli
- name: Install PlantUML
run: |
sudo apt-get update -q
sudo apt-get install -y --no-install-recommends default-jre-headless plantuml

- name: Install Excalidraw CLI
run: npm install -g @swiftlysingh/excalidraw-cli

- name: Install Playwright + Firefox
# Uses the locally installed playwright (correct version) to install Firefox
run: npx playwright install --with-deps firefox
- name: Install diagram-sync
run: npm install -g diagram-sync

# On PR → validates every .excalidraw can be exported (job fails = PR blocked)
# On PR → validates every diagram can be exported (job fails = PR blocked)
# On push → same step, but followed by the commit step below
- name: Export .excalidraw files → diagrams/
run: |
set -eo pipefail
find . -name "*.excalidraw" \
-not -path "./.git/*" \
-not -path "./node_modules/*" \
| while IFS= read -r file; do
rel="${file#./}"
out="diagrams/${rel%.excalidraw}.svg"
mkdir -p "$(dirname "$out")"
echo "Exporting: $rel → $out"
npx excalidraw-brute-export-cli \
-i "$file" \
--format svg \
--scale 1 \
--background 1 \
--embed-scene 0 \
--dark-mode 0 \
-o "$out"
done
- name: Export diagram files → diagrams/
run: diagram-sync

# Commits back on push to main (PR merged) or manual workflow_dispatch
# Skipped entirely during PR validation runs
- name: Commit exported SVGs to main
- name: Commit exported diagrams to main
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
git config user.name "github-actions[bot]"
Expand All @@ -74,7 +62,7 @@ jobs:
if git diff --staged --quiet; then
echo "No diagram changes to commit."
else
git commit -m "chore: auto-export excalidraw diagrams [skip ci]"
git commit -m "chore: auto-export diagrams [skip ci]"
git pull --rebase origin main
git push
fi
112 changes: 60 additions & 52 deletions docs/architecture/00-baseline/v1/url-shortener-v1-hld.excalidraw
Original file line number Diff line number Diff line change
Expand Up @@ -2138,8 +2138,8 @@
"frameId": null,
"x": -220.66529003471368,
"y": -303.5077851544676,
"width": 171.50159565320678,
"height": 128.9607875234742,
"width": 153.29535786023803,
"height": 125.23422502347421,
"angle": 0,
"strokeColor": "#f08c00",
"backgroundColor": "transparent",
Expand All @@ -2151,16 +2151,16 @@
"groupIds": [],
"roundness": null,
"seed": 1036090294,
"version": 4124,
"versionNonce": 675132968,
"version": 4179,
"versionNonce": 648276660,
"isDeleted": false,
"boundElements": [
{
"id": "AIeHzK18lJWz60vjlutAx",
"type": "text"
}
],
"updated": 1774769149312,
"updated": 1780887497358,
"link": null,
"locked": false,
"points": [
Expand All @@ -2170,15 +2170,15 @@
],
[
0,
63.59563320416075
61.73235195416075
],
[
171.50159565320678,
63.59563320416075
153.29535786023803,
61.73235195416075
],
[
171.50159565320678,
128.9607875234742
153.29535786023803,
125.23422502347421
]
],
"lastCommittedPoint": null,
Expand Down Expand Up @@ -2255,10 +2255,10 @@
"type": "arrow",
"index": "agG",
"frameId": null,
"x": -50.10924709348319,
"y": -54.621333771234035,
"width": 308.1567959810417,
"height": 175.36087468829965,
"x": -68.31548488645194,
"y": -58.347896271234035,
"width": 326.36303377401043,
"height": 179.08743718829965,
"angle": 0,
"strokeColor": "#f08c00",
"backgroundColor": "transparent",
Expand All @@ -2270,16 +2270,16 @@
"groupIds": [],
"roundness": null,
"seed": 1565690968,
"version": 4831,
"versionNonce": 913617192,
"version": 4887,
"versionNonce": 1655437108,
"isDeleted": false,
"boundElements": [
{
"id": "q9KVWSku_HTql4OztURKJ",
"type": "text"
}
],
"updated": 1774769149313,
"updated": 1780887497472,
"link": null,
"locked": false,
"points": [
Expand All @@ -2289,19 +2289,19 @@
],
[
0,
111.42588623872977
115.15244873872977
],
[
97.94944876125368,
111.42588623872977
116.15568655422243,
115.15244873872977
],
[
97.94944876125368,
175.36087468829965
116.15568655422243,
179.08743718829965
],
[
308.1567959810417,
175.36087468829965
326.36303377401043,
179.08743718829965
]
],
"lastCommittedPoint": null,
Expand Down Expand Up @@ -2337,22 +2337,22 @@
"index": 2,
"start": [
0,
111.42588623872977
115.15244873872977
],
"end": [
97.94944876125368,
111.42588623872977
116.15568655422243,
115.15244873872977
]
},
{
"index": 3,
"start": [
97.94944876125368,
111.42588623872977
116.15568655422243,
115.15244873872977
],
"end": [
97.94944876125368,
175.36087468829965
116.15568655422243,
179.08743718829965
]
}
],
Expand Down Expand Up @@ -2401,10 +2401,10 @@
"type": "arrow",
"index": "agd",
"frameId": null,
"x": -179.99130314362878,
"y": -54.43363240533003,
"width": 0.5090771940789693,
"height": 183.66922976935638,
"x": -198.19754093659753,
"y": -58.16019490533003,
"width": 28.24434257472356,
"height": 188.16026601866412,
"angle": 0,
"strokeColor": "#f08c00",
"backgroundColor": "transparent",
Expand All @@ -2416,16 +2416,16 @@
"groupIds": [],
"roundness": null,
"seed": 777376600,
"version": 5581,
"versionNonce": 843957800,
"version": 5651,
"versionNonce": 330421556,
"isDeleted": false,
"boundElements": [
{
"id": "6EfIXbMzRtJlLO1vtPj_v",
"type": "text"
}
],
"updated": 1774769151817,
"updated": 1780888335799,
"link": null,
"locked": false,
"points": [
Expand All @@ -2434,8 +2434,16 @@
0
],
[
0.5090771940789693,
183.66922976935638
0,
94.08843335104227
],
[
28.24434257472356,
94.08843335104227
],
[
28.24434257472356,
188.16026601866412
]
],
"lastCommittedPoint": null,
Expand All @@ -2451,8 +2459,8 @@
"endBinding": {
"elementId": "nR-2GIajiYPMjhAoZLsck",
"fixedPoint": [
0.49952875878787484,
-0.04326026653429992
0.38199112218058967,
-0.0450853090287157
],
"focus": 0,
"gap": 0
Expand Down Expand Up @@ -3179,8 +3187,8 @@
"type": "rectangle",
"index": "ay",
"frameId": null,
"x": -209.12305427739824,
"y": -169.6279692219096,
"x": -227.329292070367,
"y": -173.3545317219096,
"width": 199.74500710497375,
"height": 110,
"angle": 0,
Expand All @@ -3196,8 +3204,8 @@
"type": 3
},
"seed": 1430654040,
"version": 1498,
"versionNonce": 2066601560,
"version": 1553,
"versionNonce": 968050612,
"isDeleted": false,
"boundElements": [
{
Expand All @@ -3217,15 +3225,15 @@
"type": "arrow"
}
],
"updated": 1774769149311,
"updated": 1780887497357,
"link": null,
"locked": false
},
{
"id": "qKIIAMdmMGTIov9tNsvuj",
"type": "text",
"x": -197.94049213116136,
"y": -164.6279692219096,
"x": -216.1467299241301,
"y": -168.3545317219096,
"width": 177.3798828125,
"height": 100,
"angle": 0,
Expand All @@ -3241,11 +3249,11 @@
"index": "az",
"roundness": null,
"seed": 376619352,
"version": 283,
"versionNonce": 921661992,
"version": 338,
"versionNonce": 2027434292,
"isDeleted": false,
"boundElements": [],
"updated": 1774769106192,
"updated": 1780887497357,
"link": null,
"locked": false,
"text": "Cloudflare\n(DDoS Absorption\nWAF Rate Limiting\nDNS Proxy)",
Expand Down
Loading