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
84 changes: 84 additions & 0 deletions diagrams/docs/architecture/00-baseline/v1/URLShortenerV1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions diagrams/docs/architecture/00-baseline/v2/URLShortenerV2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/hld/database/v1/db-design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/hld/database/v1/er-db.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/hld/database/v2/db-design.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/hld/database/v2/er-db.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions diagrams/docs/lld/c4-deployment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions diagrams/docs/lld/c4-level1-system-context.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions diagrams/docs/lld/c4-level2-container.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions diagrams/docs/lld/c4-level3-component.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions diagrams/docs/lld/c4-level4-code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v1/UC-US-001-shorten-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v1/UC-US-002-redirect-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v1/UC-US-003-expire-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v2/UC-US-001-shorten-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v2/UC-US-002-redirect-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v2/UC-US-003-expire-url.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions diagrams/docs/use-cases/v2/UC-US-004-custom-alias.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading