-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.42 KB
/
Copy pathdeploy.yml
File metadata and controls
86 lines (71 loc) · 2.42 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
name: Deploy production
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: production
cancel-in-progress: false
env:
OF_DATABASE: of-lobby
OF_WEB_DATABASE: of-match
OF_WEB_HOST: https://maincloud.spacetimedb.com
SPACETIMEDB_SERVER: maincloud
VERCEL_PROJECT: of
VERCEL_SCOPE: dc-ss
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Install pinned Rust toolchain
run: |
rustup show
rustup target add wasm32-unknown-unknown
- name: Cache Rust build outputs
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
modules/match -> modules/match/target
- name: Install pinned SpacetimeDB CLI
run: |
curl -sSf https://install.spacetimedb.com | sh -s -- --yes
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/spacetime" version install 2.7.1 --use --yes
- name: Install pinned Trunk
uses: taiki-e/install-action@v2
with:
tool: trunk@0.21.14
- name: Build production deployment
run: ./scripts/build-vercel-production.sh
- name: Enforce web bundle size gate
run: ./scripts/measure-web-bundle.sh --dist target/web --enforce
- name: Publish authoritative module
env:
SPACETIMEDB_TOKEN: ${{ secrets.SPACETIMEDB_TOKEN }}
run: |
: "${SPACETIMEDB_TOKEN:?Configure the SPACETIMEDB_TOKEN repository secret}"
spacetime login --token "$SPACETIMEDB_TOKEN"
./scripts/publish-production.sh
- name: Install pinned Vercel CLI
run: npm install --global vercel@58.7.1
- name: Deploy web client
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
SPACETIMEDB_TOKEN: ${{ secrets.SPACETIMEDB_TOKEN }}
run: |
: "${VERCEL_TOKEN:?Configure the VERCEL_TOKEN repository secret}"
: "${SPACETIMEDB_TOKEN:?Configure the SPACETIMEDB_TOKEN repository secret}"
vercel deploy target/vercel \
--prod \
--yes \
--project "$VERCEL_PROJECT" \
--scope "$VERCEL_SCOPE" \
--env "SPACETIME_HOST=$OF_WEB_HOST" \
--env "LOBBY_DATABASE=$OF_DATABASE" \
--env "SPACETIMEDB_TOKEN=$SPACETIMEDB_TOKEN" \
--token "$VERCEL_TOKEN"