This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Repository navigation
89 lines (73 loc) · 2.56 KB
/
Copy pathweb.yml
File metadata and controls
89 lines (73 loc) · 2.56 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
name: web
on:
push:
branches: [main]
paths-ignore:
- "*.md"
- ".vscode/**"
- "LICENCE"
- ".github/workflows/code-coverage.yml"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.0.2
with:
fetch-depth: 1
lfs: true
- name: Install Rust
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
components: llvm-tools-preview
- uses: jetli/wasm-bindgen-action@v0.1.0
with:
version: "latest"
- name: ⚡ Cache
uses: Swatinem/rust-cache@v2.0.0
if: ${{ !env.ACT }}
- name: Extract Test Data
run: 7z x -t7z ${{ github.workspace }}/assets/test-data.7z -o${{ github.workspace }}/ -p'${{ secrets.TEST_DATA_ARCHIVE_PASSWORD }}' -aoa
- name: Build
working-directory: ${{ github.workspace }}/crates/head-wasm
run: |
cargo build --release --target wasm32-unknown-unknown --target-dir target
env:
TEST_PREVIEW_HASH: ${{ secrets.TEST_PREVIEW_HASH }}
- name: Generate the .wasm for web deploy.
working-directory: ${{ github.workspace }}/crates/head-wasm
run: wasm-bindgen --out-name rrr --out-dir ${{ github.workspace }}/web/bin --target web target/wasm32-unknown-unknown/release/rrr_head_wasm.wasm
- name: Build Workers
working-directory: ${{ github.workspace }}/crates/wasm-workers
run: |
cargo build --release --bins --target wasm32-unknown-unknown --target-dir target
env:
TEST_PREVIEW_HASH: ${{ secrets.TEST_PREVIEW_HASH }}
- name: Generate web workers
working-directory: ${{ github.workspace }}/crates/wasm-workers
run: wasm-bindgen --no-typescript --out-name fetch-worker --out-dir ${{ github.workspace }}/web/bin --target no-modules target/wasm32-unknown-unknown/release/fetch.wasm
- name: Upload Web Directory
uses: actions/upload-artifact@v3
with:
name: web-directory
path: ./web
deploy-pages:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: web-directory
path: ./web
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web
cname: rrr.flashflashrevolution.com
keep_files: true