-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
79 lines (67 loc) · 2.23 KB
/
website.yml
File metadata and controls
79 lines (67 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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: 🦀 Produce auto-generated code docs data
run: |
rustup update stable
cargo run -p crate-hierarchy-viz -- website/generated
cargo run -p editor-message-tree -- website/generated
- name: 🔧 Install website npm dependencies
run: |
cd website
npm ci
- 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