Add the crate dependency graph visualization to the contributor guide #1117
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Website" | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - website/** | |
| pull_request: | |
| paths: | |
| - website/** | |
| env: | |
| CARGO_TERM_COLOR: always | |
| INDEX_HTML_HEAD_INCLUSION: <script defer data-domain="graphite.art" data-api="/visit/event" src="/visit/script.hash.js"></script> | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - name: 📥 Clone repository | |
| uses: actions/checkout@v6 | |
| - name: 🟢 Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: 🕸 Install Zola | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: zola@0.22.0 | |
| - name: 🔍 Check if `website/other` directory changed | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| website-other: | |
| - "website/other/**" | |
| - name: ✂ Replace template in <head> of index.html | |
| run: | | |
| # Remove the INDEX_HTML_HEAD_INCLUSION environment variable for build links (not master deploys) | |
| git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_INCLUSION="" | |
| - name: 💿 Obtain cache of auto-generated code docs artifacts | |
| id: cache-website-code-docs | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: website/generated | |
| key: website-code-docs | |
| - name: 📁 Fallback in case auto-generated code docs artifacts weren't cached | |
| if: steps.cache-website-code-docs.outputs.cache-hit != 'true' | |
| run: | | |
| echo "🦀 Initial system version of Rust:" | |
| rustc --version | |
| rustup update stable | |
| echo "🦀 Latest updated version of Rust:" | |
| rustc --version | |
| cargo run -p crate-hierarchy-viz -- website/generated/crate_hierarchy.dot | |
| cargo run -p editor-message-tree -- website/generated/hierarchical_message_system_tree.txt | |
| - name: 🔧 Build auto-generated code docs artifacts into HTML/SVG | |
| run: | | |
| cd website | |
| npm ci | |
| npm run generate-editor-structure | |
| npm run generate-crate-hierarchy | |
| - name: 📃 Generate node catalog documentation | |
| run: cargo run -p node-docs -- website/content/learn/node-catalog | |
| - name: 🌐 Build Graphite website with Zola | |
| env: | |
| MODE: prod | |
| run: | | |
| cd website | |
| npm run check | |
| zola --config config.toml build --minify | |
| - name: 📤 Publish to Cloudflare Pages | |
| continue-on-error: true | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| run: npx wrangler@3 pages deploy "website/public" --project-name="graphite-website" --commit-dirty=true |