-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.18 KB
/
ci_cd.yaml
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
name: Build and deploy to Cloudflare Workers
on:
push:
workflow_dispatch:
concurrency:
group: deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
name: Build and Deploy master
steps:
- uses: actions/checkout@v4
- name: Cache build
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
node_modules/
/usr/share/rust/.rustup/
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-
- uses: dtolnay/rust-toolchain@stable
with:
targets: "wasm32-unknown-unknown"
- name: Build
run: |
npm install
npx wrangler deploy --dry-run
- name: Deploy
if: ${{ github.ref_type == 'branch' && github.ref_name == 'master' }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_TOKEN }}
run: |
npm install
npx wrangler deploy