Skip to content

Commit ff0c511

Browse files
authored
Cloudflare Pages (#62)
* CI * try node 20 * ci: don't test types and lint when build already does
1 parent 034f4c2 commit ff0c511

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI/CD
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
permissions:
16+
contents: read
17+
deployments: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: '.nvmrc'
25+
- name: Install dependencies
26+
run: npm ci
27+
- name: Build
28+
run: npm run build
29+
- name: Export static files
30+
run: npm run export
31+
- name: Publish to Cloudflare Pages
32+
uses: cloudflare/pages-action@v1
33+
with:
34+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
35+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
36+
projectName: r3f-gravity-ball
37+
directory: out
38+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
39+
- name: Upload build artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: build
43+
path: ./out

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "next start",
99
"export": "next export",
1010
"prod": "serve out",
11-
"lint": "next lint",
11+
"test:lint": "next lint",
1212
"test:types": "tsc",
1313
"deps:update": "npm i $(npm outdated | cut -d' ' -f 1 | sed '1d' | xargs -I '$' echo '$@latest' | xargs echo) --save-exact"
1414
},

0 commit comments

Comments
 (0)