Skip to content

Commit 2918add

Browse files
authored
Create deploy.yml
1 parent 9acdafb commit 2918add

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy Next.js to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or your default branch
7+
8+
permissions:
9+
contents: write # needed to push to gh-pages branch
10+
11+
jobs:
12+
build-deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: ⬇️ Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: ⚙️ Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
24+
- name: 📦 Install dependencies
25+
run: npm install
26+
27+
- name: 🛠 Build & export static site
28+
run: |
29+
npm run build
30+
npx next export
31+
32+
- name: 🚀 Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./out

0 commit comments

Comments
 (0)