Skip to content

Commit

Permalink
Initial commit with github pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumppi066 committed Dec 31, 2024
1 parent 966991c commit 137a2a0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy Next.js App to GitHub Pages

on:
push:
branches:
- main

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

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Build the app
run: npm run build

- name: Export the app
run: npm run export

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out # The directory where the static files are generated
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# vscode
.vscode
10 changes: 7 additions & 3 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
const nextConfig = {
output: 'export',
basePath: process.env.NODE_ENV === 'production' ? '/frontend' : '',
assetPrefix: process.env.NODE_ENV === 'production' ? '/frontend/' : '',
};

export default nextConfig;
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next export",
"start": "next start > nul 2>&1",
"lint": "next lint"
},
Expand Down

0 comments on commit 137a2a0

Please sign in to comment.