-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (71 loc) · 2.38 KB
/
Copy pathnextjs.yml
File metadata and controls
90 lines (71 loc) · 2.38 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Deploy Next.js site to Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
env:
# Tell next.config.mjs to activate static export mode (output: 'export',
# images.unoptimized, no server-only hooks). Required for GitHub Pages.
GITHUB_PAGES: true
# GitHub Stats backend URL (must match the var name used in your code)
NEXT_PUBLIC_BACKEND_URL: ${{ secrets.BACKEND_URL }}
# Contact form (Formspree)
NEXT_PUBLIC_FORMSPREE_FORM_ID: ${{ secrets.FORMSPREE_FORM_ID }}
# SEO & Verification
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION: ${{ secrets.GOOGLE_SITE_VERIFICATION }}
# Anti-spam CAPTCHA (Cloudflare Turnstile — public site key only)
NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${{ secrets.TURNSTILE_SITE_KEY }}
# Personal info shown on the site
NEXT_PUBLIC_EMAIL: ${{ secrets.EMAIL }}
NEXT_PUBLIC_UPI_ID: ${{ secrets.UPI_ID }}
NEXT_PUBLIC_BUYMEACOFFEE_USERNAME: ${{ secrets.BUYMEACOFFEE_USERNAME }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
# setup-bun handles its own cache via bun.lock — no need for setup-node
- name: Setup Pages
uses: actions/configure-pages@v5
with:
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock') }}-
- name: Install dependencies
run: bun install
- name: Lint with ESLint
run: bun run lint
- name: Build with Next.js
run: bun run build
- name: Add CNAME
run: echo "amitxd.in" > ./out/CNAME
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4