Fix, document, and update npm dependencies and tooling; fix Bezier-rs demos not building (#1857)

Fix, document, and update npm dependencies; fix Bezier-rs demos not building

Closes #1853
This commit is contained in:
Keavon Chambers
2024-07-24 18:05:01 -07:00
parent ab8748627d
commit e1df23c28e
17 changed files with 510 additions and 1266 deletions
+68
View File
@@ -0,0 +1,68 @@
name: "Editor: Production (Latest Stable)"
on:
push:
tags:
- "latest-stable"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: self-hosted
permissions:
contents: read
deployments: write
env:
RUSTC_WRAPPER: /usr/bin/sccache
CARGO_INCREMENTAL: 0
SCCACHE_DIR: /var/lib/github-actions/.cache
INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="editor.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.hash.js"></script>
steps:
- name: 📥 Clone and checkout repository
uses: actions/checkout@v3
- name: 🗑 Clear wasm-bindgen cache
run: rm -r ~/.cache/.wasm-pack
- name: 🟢 Install the latest Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
- name: 🚧 Install Node dependencies
run: |
cd frontend
npm ci
- name: 🦀 Install the latest Rust
run: |
echo "Initial system version:"
rustc --version
rustup update stable
echo "Latest updated version:"
rustc --version
- name: ✂ Replace template in <head> of index.html
run: |
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
- name: 🌐 Build Graphite web code
env:
NODE_ENV: production
run: |
cd frontend
mold -run npm run build
- name: 📤 Publish to Cloudflare Pages
id: cloudflare
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: graphite-editor
directory: frontend/dist
branch: master