-
Notifications
You must be signed in to change notification settings - Fork 8
99 lines (78 loc) · 2.41 KB
/
deploy.yml
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
name: Deploy website via GitHub Pages
on:
push:
branches:
- main
defaults:
run:
working-directory: website
jobs:
deploy:
name: Deploy p2panda website
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm install
- name: Build website
run: npm run build
- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
cname: p2panda.org
deploy-js-docs:
name: Deploy p2panda-js API documentation
runs-on: ubuntu-latest
steps:
- name: Checkout p2panda-js repository
uses: actions/checkout@v3
with:
repository: 'p2panda/p2panda'
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install wasm-bindgen
uses: jetli/[email protected]
- name: Install wasm-opt
uses: giantswarm/install-binary-action@v1
with:
binary: "wasm-opt"
version: "109"
download_url: "https://github.com/WebAssembly/binaryen/releases/download/version_${version}/binaryen-version_${version}-x86_64-linux.tar.gz"
tarball_binary_path: "*/bin/${binary}"
smoke_test: "${binary} --version"
- name: Install dependencies
run: npm ci
working-directory: p2panda-js
- name: Compile wasm and build p2panda-js
run: npm run build
working-directory: p2panda-js
- name: Build documentation page
run: npm run docs
working-directory: p2panda-js
- name: Deploy website
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: p2panda-js/docs
destination_dir: lib/p2panda-js