-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.47 KB
/
Copy pathcloudflare-pages.yml
File metadata and controls
57 lines (46 loc) · 1.47 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
name: ☁️ Deploy to Cloudflare Pages
on:
push:
branches: ['**']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cloudflare-pages-${{ github.ref_name }}
cancel-in-progress: true
jobs:
deploy:
name: 🏗 Build and Deploy
runs-on: ubuntu-latest
steps:
- name: 🔍 Checkout repository
uses: actions/checkout@v4
- name: 📦 Install pnpm
run: npm install -g pnpm@10
- name: ⚙️ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'pnpm'
- name: 🚫 Remove server-only paths for export build
run: |
echo "Pruning dynamic/server paths not supported by static export..."
rm -rf src/app/api src/server src/proxy.ts src/app/jobs/[id] src/app/[...not-found] prisma.config.ts
- name: 📥 Install dependencies
run: pnpm install --frozen-lockfile
- name: 🏗 Build static export
env:
NEXT_OUTPUT_MODE: export
GITHUB_PAGES: 1
NEXT_BASE_PATH: ''
run: |
pnpm build
- name: 🚀 Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: >-
pages deploy out
--project-name=${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }}
--branch=${{ github.ref_name }}