Skip to content

Commit 1e38ad3

Browse files
committed
ci: add Cloudflare Pages deploy job to CI workflow
1 parent 965aba0 commit 1e38ad3

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: CI
22

33
on:
44
push:
5-
branches-ignore: [ main ]
65
pull_request:
76
branches: [ main ]
87

98
permissions:
109
contents: read
10+
deployments: write
1111

1212
jobs:
1313
build:
@@ -84,3 +84,32 @@ jobs:
8484
name: playwright-report
8585
path: playwright-report/
8686
retention-days: 14
87+
88+
deploy:
89+
runs-on: ubuntu-latest
90+
needs: build
91+
if: github.event_name == 'push'
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v4
95+
96+
- name: Setup Node
97+
uses: actions/setup-node@v4
98+
with:
99+
node-version: '20'
100+
cache: 'npm'
101+
102+
- name: Install dependencies
103+
run: npm ci
104+
105+
- name: Build
106+
run: npm run build
107+
env:
108+
NODE_OPTIONS: "--max_old_space_size=4096"
109+
110+
- name: Deploy to Cloudflare Pages
111+
uses: cloudflare/wrangler-action@v3
112+
with:
113+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
114+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
115+
command: pages deploy dist --project-name=super-json --branch=${{ github.ref_name }}

0 commit comments

Comments
 (0)