Skip to content

Commit 5c55e8d

Browse files
committed
Migrate to Cloudflare Pages and add CI/CD
- Migrate from Workers Sites to Cloudflare Pages - Add _headers for WASM SharedArrayBuffer support - Remove legacy workers-site configuration - Add GitHub Actions CI/CD workflow - Update project name to 'evo' - Format Rust code
1 parent 9bf2886 commit 5c55e8d

File tree

13 files changed

+584
-628
lines changed

13 files changed

+584
-628
lines changed

.github/workflows/ci-cd.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check & Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
components: rustfmt, clippy
23+
24+
- name: Install wasm32 target
25+
run: rustup target add wasm32-unknown-unknown
26+
27+
- name: Cache Cargo
28+
uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cargo/bin/
32+
~/.cargo/registry/index/
33+
~/.cargo/registry/cache/
34+
~/.cargo/git/db/
35+
target/
36+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-cargo-
39+
40+
- name: Check formatting
41+
run: cargo fmt --check
42+
43+
- name: Run clippy
44+
run: cargo clippy -- -D warnings
45+
46+
- name: Run tests
47+
run: cargo test
48+
49+
- name: Check WASM build
50+
run: cargo check --target wasm32-unknown-unknown
51+
52+
deploy:
53+
name: Deploy
54+
runs-on: ubuntu-latest
55+
needs: check
56+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Install Rust
61+
uses: dtolnay/rust-toolchain@stable
62+
63+
- name: Install wasm32 target
64+
run: rustup target add wasm32-unknown-unknown
65+
66+
- name: Install wasm-pack
67+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: '20'
73+
cache: 'npm'
74+
75+
- name: Install dependencies
76+
run: npm ci
77+
78+
- name: Build
79+
run: npm run build:web
80+
81+
- name: Deploy to Cloudflare Pages
82+
uses: cloudflare/wrangler-action@v3
83+
with:
84+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
85+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
86+
command: pages deploy web --project-name=evo

0 commit comments

Comments
 (0)