Skip to content

Commit

Permalink
Cloudflare Pages (#62)
Browse files Browse the repository at this point in the history
* CI

* try node 20

* ci: don't test types and lint when build already does
  • Loading branch information
satelllte authored Mar 24, 2024
1 parent 034f4c2 commit ff0c511
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI/CD

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
deployments: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Export static files
run: npm run export
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: r3f-gravity-ball
directory: out
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: ./out
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "next start",
"export": "next export",
"prod": "serve out",
"lint": "next lint",
"test:lint": "next lint",
"test:types": "tsc",
"deps:update": "npm i $(npm outdated | cut -d' ' -f 1 | sed '1d' | xargs -I '$' echo '$@latest' | xargs echo) --save-exact"
},
Expand Down

0 comments on commit ff0c511

Please sign in to comment.