Skip to content

Commit a218665

Browse files
committed
Init gh-pages Nextjs
1 parent cba278e commit a218665

File tree

17 files changed

+6205
-94
lines changed

17 files changed

+6205
-94
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.github/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Deploy Next.js site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: [$default-branch]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
# Build job
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Detect package manager
30+
id: detect-package-manager
31+
run: |
32+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
33+
echo "manager=yarn" >> $GITHUB_OUTPUT
34+
echo "command=install" >> $GITHUB_OUTPUT
35+
echo "runner=yarn" >> $GITHUB_OUTPUT
36+
exit 0
37+
elif [ -f "${{ github.workspace }}/package.json" ]; then
38+
echo "manager=npm" >> $GITHUB_OUTPUT
39+
echo "command=ci" >> $GITHUB_OUTPUT
40+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
41+
exit 0
42+
else
43+
echo "Unable to determine packager manager"
44+
exit 1
45+
fi
46+
- name: Setup Node
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: "16"
50+
cache: ${{ steps.detect-package-manager.outputs.manager }}
51+
- name: Setup Pages
52+
uses: actions/configure-pages@v3
53+
with:
54+
# Automatically inject basePath in your Next.js configuration file and disable
55+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
56+
#
57+
# You may remove this line if you want to manage the configuration yourself.
58+
static_site_generator: next
59+
- name: Restore cache
60+
uses: actions/cache@v3
61+
with:
62+
path: |
63+
.next/cache
64+
# Generate a new cache whenever packages or source files change.
65+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
66+
# If source files changed but packages didn't, rebuild from a prior cache.
67+
restore-keys: |
68+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
69+
- name: Install dependencies
70+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
71+
- name: Build with Next.js
72+
run: ${{ steps.detect-package-manager.outputs.runner }} next build
73+
- name: Static HTML export with Next.js
74+
run: ${{ steps.detect-package-manager.outputs.runner }} next export
75+
- name: Upload artifact
76+
uses: actions/upload-pages-artifact@v1
77+
with:
78+
path: ./out
79+
80+
# Deployment job
81+
deploy:
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
runs-on: ubuntu-latest
86+
needs: build
87+
steps:
88+
- name: Deploy to GitHub Pages
89+
id: deployment
90+
uses: actions/deploy-pages@v1

.gitignore

Lines changed: 26 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,36 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
112

12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
177

18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
8+
# testing
9+
/coverage
2010

21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
11+
# next.js
12+
/.next/
13+
/out/
2414

25-
# nyc test coverage
26-
.nyc_output
15+
# production
16+
/build
2717

28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
18+
# misc
19+
.DS_Store
20+
*.pem
3021

31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
3927

40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
28+
# local env files
29+
.env*.local
4330

44-
# TypeScript v1 declaration files
45-
typings/
31+
# vercel
32+
.vercel
4633

47-
# TypeScript cache
34+
# typescript
4835
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
72-
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
36+
next-env.d.ts

next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
images: {
5+
unoptimized: true
6+
},
7+
}
8+
9+
module.exports = nextConfig

0 commit comments

Comments
 (0)