Skip to content

Commit 41989ae

Browse files
Github pages workflow
1 parent 8a8087d commit 41989ae

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: publish-to-github-pages
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout 🛎️
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
25+
uses: ./.github/workflows/setup-node
26+
27+
- name: Setup Pages ⚙️
28+
uses: actions/configure-pages@v4
29+
with:
30+
static_site_generator: next
31+
32+
- name: Build with Next.js 🏗️
33+
run: npm run build
34+
35+
- name: Upload artifact 📡
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: ./out
39+
40+
deploy:
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
45+
runs-on: ubuntu-latest
46+
needs: build
47+
48+
steps:
49+
- name: Publish to GitHub Pages 🚀
50+
id: deployment
51+
uses: actions/deploy-pages@v4
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: setup-node
2+
description: "Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Setup Node.js ⚙️
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version: 20
10+
11+
- name: Cache dependencies ⚡
12+
id: cache_dependencies
13+
uses: actions/cache@v3
14+
with:
15+
path: node_modules
16+
key: node-modules-${{ hashFiles('package-lock.json') }}
17+
18+
- name: Install dependencies 🔧
19+
shell: bash
20+
if: steps.cache_dependencies.outputs.cache-hit != 'true'
21+
run: npm ci

next.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
/* config options here */
4+
output: "export",
5+
reactStrictMode: true,
56
};
67

78
export default nextConfig;

0 commit comments

Comments
 (0)