Skip to content

Commit

Permalink
Build: deployment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-jin committed Sep 15, 2024
1 parent 8ea3913 commit 2e99a35
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to GitHub Pages

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Setup Node.js ⚙️
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies 📦
run: npm ci

- name: Build and Export 🏗️
run: npm run export

- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: out
8 changes: 7 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
output: 'export',
images: {
unoptimized: true,
},
basePath: process.env.NODE_ENV === 'production' ? '/portfolio' : '',
};

export default nextConfig;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"export": "next build && next export && touch out/.nojekyll"
},
"dependencies": {
"gray-matter": "^4.0.3",
Expand Down

0 comments on commit 2e99a35

Please sign in to comment.