Skip to content

Commit b7bcfda

Browse files
committed
Deploy to cloudfare
1 parent 2db3ba2 commit b7bcfda

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to Cloudflare Pages
2+
on:
3+
push:
4+
branches: [main]
5+
6+
permissions:
7+
contents: read
8+
deployments: write
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
name: Deploy to Cloudflare Pages
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: 'package-lock.json'
25+
26+
- name: Install Dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Deploy to Cloudflare Pages
33+
uses: cloudflare/pages-action@v1
34+
with:
35+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
36+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
37+
projectName: 'portfolio'
38+
directory: 'out'
39+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ yarn-error.log*
1515

1616
# typescript
1717
*.tsbuildinfo
18-
next-env.d.ts
18+
next-env.d.ts
19+
20+
21+
.env

next.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3+
output: 'export',
4+
trailingSlash: true,
35
eslint: {
46
ignoreDuringBuilds: true,
57
},

0 commit comments

Comments
 (0)