-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (55 loc) · 1.64 KB
/
deploy.yml
File metadata and controls
69 lines (55 loc) · 1.64 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
name: Deploy
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}"
on:
workflow_dispatch:
merge_group:
pull_request:
branches:
- main
push:
branches:
- main
env:
CACHE_TIMEOUT_MINUTES: 5
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: sccache
CC: sccache clang
CXX: sccache clang++
FAUCET_TOPUP_REQ_URL: '${{ vars.FAUCET_TOPUP_REQ_URL }}'
FAUCET_TX_URL_CALIBNET: '${{ vars.FAUCET_TX_URL_CALIBNET }}'
FAUCET_TX_URL_MAINNET: '${{ vars.FAUCET_TX_URL_MAINNET }}'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
timeout-minutes: "${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}"
continue-on-error: true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install wasm-pack
run:
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- uses: sigoden/install-binary@v1
with:
repo: WebAssembly/binaryen
name: wasm-opt
- name: Install worker-build
run: cargo install --locked worker-build
- run: corepack enable
- run: yarn --immutable
- name: Dry Run
if: github.ref != 'refs/heads/main'
uses: cloudflare/wrangler-action@v3
with:
command: deploy --dry-run
- name: Publish
if: github.ref == 'refs/heads/main'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}