-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.35 KB
/
deploy.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
name: Deploy
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
shell: bash
env:
NAME: 'url-shortener'
CARGO_TERM_COLOR: 'always'
ACTIONS_RUNNER_DEBUG: true
jobs:
deploy:
runs-on: ['ubuntu-latest']
steps:
- name: 🔑 Checkout
uses: actions/checkout@v4
- name: 🦀 Set up Rust
run: |
rustup set auto-self-update disable
rustup toolchain install 1.81.0 --profile minimal
rustup default 1.81.0
- uses: Swatinem/[email protected]
with:
prefix-key: v0 # increment this to bust the cache if needed
- name: Install sccache
uses: mozilla-actions/[email protected]
env:
RUSTC_WRAPPER: 'sccache'
SCCACHE_GHA_ENABLED: true
- name: 🛠️ Build worker
run: cargo install --quiet worker-build && worker-build --release
- name: 🐰 Set up Bun
uses: oven-sh/setup-bun@main
with:
bun-version: 'latest'
- name: 🔸 Cloudflare Workers - Deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
bun x wrangler@latest deploy \
--env='production' \
--config='wrangler.toml'