-
Notifications
You must be signed in to change notification settings - Fork 5
80 lines (68 loc) · 2.39 KB
/
Copy pathdeploy.yml
File metadata and controls
80 lines (68 loc) · 2.39 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
name: Deploy
on:
workflow_dispatch:
concurrency:
group: production-deploy
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
HOSTING_AUTH_TOKEN: ${{ secrets.HOSTING_AUTH_TOKEN }}
HOSTING_SITE_ID: ${{ secrets.HOSTING_SITE_ID }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CSSQUAKE_R2_BUCKET: ${{ vars.CSSQUAKE_R2_BUCKET || secrets.CSSQUAKE_R2_BUCKET || 'cssquake-assets' }}
QUAKE_RENDER_BUNDLE_AVIF_EFFORT: "0"
QUAKE_SHAREWARE_URL: ${{ secrets.QUAKE_SHAREWARE_URL }}
VITE_CSSQUAKE_PARTY_HOST: ${{ vars.VITE_CSSQUAKE_PARTY_HOST }}
VITE_QUAKE_ASSET_ROOT: ${{ vars.VITE_QUAKE_ASSET_ROOT || secrets.VITE_QUAKE_ASSET_ROOT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 10.33.0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Check build inputs
run: |
test -n "$QUAKE_SHAREWARE_URL"
test -n "$HOSTING_AUTH_TOKEN"
test -n "$HOSTING_SITE_ID"
test -n "$CLOUDFLARE_ACCOUNT_ID"
test -n "$CLOUDFLARE_API_TOKEN"
test -n "$CSSQUAKE_R2_BUCKET"
test -n "$VITE_CSSQUAKE_PARTY_HOST"
test -n "$VITE_QUAKE_ASSET_ROOT"
- name: Set versioned asset root
run: |
asset_root="${VITE_QUAKE_ASSET_ROOT%/}"
case "$asset_root" in
*/q) ;;
*)
echo "VITE_QUAKE_ASSET_ROOT must end with /q, got: $VITE_QUAKE_ASSET_ROOT"
exit 1
;;
esac
echo "CSSQUAKE_R2_KEY_PREFIX=q/${GITHUB_SHA}" >> "$GITHUB_ENV"
echo "VITE_QUAKE_ASSET_ROOT=${asset_root}/${GITHUB_SHA}" >> "$GITHUB_ENV"
- run: pnpm install --frozen-lockfile
- name: Generate Quake assets
run: pnpm prepare:quake
- name: Upload Quake assets to R2
run: pnpm deploy:upload-r2-assets
- name: Build prebuilt site
run: pnpm build
- name: Publish prebuilt site
run: |
pnpm --package=netlify-cli@latest dlx netlify deploy \
--prod \
--dir=dist \
--no-build \
--auth "$HOSTING_AUTH_TOKEN" \
--site "$HOSTING_SITE_ID"