Skip to content

Commit 0868380

Browse files
committed
gh pages
1 parent 730b14e commit 0868380

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/gh-deploy.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Deploy Next.js site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the main branch
5+
push:
6+
branches:
7+
- main
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- uses: pnpm/action-setup@v4
32+
name: Install pnpm
33+
with:
34+
version: 10
35+
run_install: false
36+
37+
- name: Install Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 22
41+
cache: "pnpm"
42+
43+
- name: Install dependencies
44+
run: pnpm install
45+
46+
- name: Setup Pages
47+
id: setup_pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Restore cache
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
.next/cache
55+
# Generate a new cache whenever packages or source files change.
56+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
57+
# If source files changed but packages didn't, rebuild from a prior cache.
58+
restore-keys: |
59+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
60+
61+
- name: Build with Next.js
62+
run: pnpm run build
63+
env:
64+
PAGES_BASE_PATH: ${{ steps.setup_pages.outputs.base_path }}
65+
66+
- name: Upload artifact
67+
uses: actions/upload-pages-artifact@v3
68+
with:
69+
path: ./out
70+
71+
deploy:
72+
environment:
73+
name: github-pages
74+
url: ${{ steps.deployment.outputs.page_url }}
75+
runs-on: ubuntu-latest
76+
needs: build
77+
steps:
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v4
File renamed without changes.

0 commit comments

Comments
 (0)