-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (89 loc) · 2.74 KB
/
gh-pages.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
100
101
102
name: GitHub Pages
on:
push:
branches:
- main
tags:
- '*'
jobs:
build_and_deploy_main:
name: Rust project for main branch
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: jetli/[email protected]
with:
version: "latest"
- run: wasm-pack build --features=web3 --target web
- run: ls
- name: copy page
run: |
mkdir public
cp index.html ./public
cp replay.html ./public
cp -r assets/ ./public
cp index.css ./public
mv pkg ./public
rm ./public/pkg/.gitignore
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public
keep_files: true
build_and_deploy_tags:
name: Rust project for tags
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: jetli/[email protected]
with:
version: "latest"
- run: wasm-pack build --features=web3 --target web
- run: ls
- name: copy page
run: |
mkdir -p ./public/${GITHUB_REF##*/}
cp index.html ./public/${GITHUB_REF##*/}
cp replay.html ./public/${GITHUB_REF##*/}
cp -r assets/ ./public/${GITHUB_REF##*/}
cp index.css ./public/${GITHUB_REF##*/}
mv pkg ./public/${GITHUB_REF##*/}
rm ./public/${GITHUB_REF##*/}/pkg/.gitignore
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./public
keep_files: true
build_and_deploy_contracts_app:
name: contracts_app for main branch
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: jetli/[email protected]
with:
version: "latest"
- run: cargo install --locked trunk
- run: cd contracts/flyconomy_contracts_app && trunk build --release --public-url /flyconomy/contracts-app/
- run: mkdir dist/ && mv contracts/flyconomy_contracts_app/dist dist/contracts-app
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./dist
keep_files: true