File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Website
2+
3+ on :
4+ push :
5+ branches : [main]
6+ workflow_dispatch :
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+
14+ - name : Setup Node.js
15+ uses : actions/setup-node@v4
16+ with :
17+ node-version : ' 20'
18+
19+ - name : Install dependencies
20+ run : npm install --legacy-peer-deps
21+
22+ - name : Build
23+ run : npm run build
24+
25+ - name : Install Wrangler
26+ run : npm install -g wrangler
27+
28+ - name : Run D1 Migrations
29+ env :
30+ CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
31+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
32+ run : |
33+ for migration in migrations/*.sql; do
34+ if [ -f "$migration" ]; then
35+ echo "Applying migration: $migration"
36+ wrangler d1 execute openboot --remote --file="$migration" || true
37+ fi
38+ done
39+
40+ - name : Deploy
41+ uses : cloudflare/wrangler-action@v3
42+ with :
43+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
44+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
You can’t perform that action at this time.
0 commit comments