-
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (97 loc) · 4.03 KB
/
deploy.yml
File metadata and controls
126 lines (97 loc) · 4.03 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Deploy to GitHub Pages
on:
push:
branches: [main]
repository_dispatch:
types: [wasm-release, docs-update]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Update WASM package (on wasm-release)
if: github.event_name == 'repository_dispatch'
run: bun add @rustledger/wasm@latest
- name: Install dependencies
run: bun install
- name: Copy WASM from npm package to pkg/
run: |
# Copy @rustledger/wasm from node_modules to pkg/ for runtime
rm -rf pkg
cp -r node_modules/@rustledger/wasm pkg
VERSION=$(jq -r '.version' pkg/package.json)
echo "WASM version from npm: $VERSION"
ls -la pkg/
- name: Check formatting
run: bun run format:check
- name: Lint
run: bun run lint
- name: Type check
run: bun run typecheck
- name: Test
run: bun run test
- name: Build main site
run: bun run build
- name: Fetch docs from rustledger repo
run: |
# Remove placeholder docs and fetch from source repo
rm -rf docs/getting-started docs/commands docs/guides docs/migration docs/reference docs/development
# Clone just the docs folder from rustledger repo
git clone --depth 1 --filter=blob:none --sparse https://github.com/rustledger/rustledger.git rustledger-temp
cd rustledger-temp
git sparse-checkout set docs
cd ..
# Copy docs content (excluding .vitepress which we maintain here)
cp -r rustledger-temp/docs/* docs/
# Use home.md as the content source for index.md hero section
# (keep our index.md for VitePress layout, append content from home.md)
rm -rf rustledger-temp
echo "Docs fetched successfully"
ls -la docs/
- name: Build rustledger docs
run: bun run docs:build
- name: Build rustfava docs
run: bun run rustfava:build
- name: Fetch pta-standards content
run: |
git clone --depth 1 https://github.com/rustledger/pta-standards.git pta-standards
echo "pta-standards content fetched"
ls -la pta-standards/
- name: Build pta-standards docs
run: bun run pta:build
- name: Merge builds
run: |
# Copy rustledger docs to dist root (base: '/')
# This overwrites the landing page - docs become the main site
cp -r docs/.vitepress/dist/* dist/
# Copy rustfava docs to dist/rustfava (base: '/rustfava/')
cp -r rustfava-docs/.vitepress/dist dist/rustfava
# Copy pta-standards docs to dist/pta-standards (base: '/pta-standards/')
cp -r pta-standards-docs/.vitepress/dist dist/pta-standards
echo "Final dist structure:"
ls -la dist/
ls -la dist/rustfava/ | head -10
ls -la dist/pta-standards/ | head -10
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4