This repository was archived by the owner on Jul 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
99 lines (81 loc) · 2.28 KB
/
Copy pathdeploy.yml
File metadata and controls
99 lines (81 loc) · 2.28 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
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Deploy to Cloudflare
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
NODE_VERSION: 20
jobs:
# Frontend deployment
deploy-frontend:
name: Deploy Frontend (Pages)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install Dependencies
run: |
cd client
npm ci
- name: Build Frontend
run: |
cd client
npm run build
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ env.CF_ACCOUNT_ID }}
command: pages deploy ./client/dist --project-name=gamify-frontend
# Backend deployment
deploy-backend:
name: Deploy Backend (Workers)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: server/package-lock.json
- name: Install Dependencies
run: |
cd server
npm ci
- name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ env.CF_ACCOUNT_ID }}
command: deploy --env production
workingDirectory: server
# Discord bot deployment (if applicable)
deploy-bot:
name: Deploy Discord Bot
runs-on: ubuntu-latest
if: false # Set to true when ready to deploy bot
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: bot/package-lock.json
- name: Install Dependencies
run: |
cd bot
npm ci
- name: Deploy Bot
run: echo "Deploy bot here"