Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 92c7c06

Browse files
rewrite the github action
1 parent 328037c commit 92c7c06

File tree

2 files changed

+98
-104
lines changed

2 files changed

+98
-104
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2+
#
3+
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4+
#
5+
name: Deploy Next.js site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["main"]
11+
paths:
12+
- "docs"
13+
14+
pull_request:
15+
types:
16+
- closed
17+
branches: ["main"]
18+
paths:
19+
- "docs"
20+
21+
# Allows you to run this workflow manually from the Actions tab
22+
workflow_dispatch:
23+
24+
25+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
26+
permissions:
27+
contents: read
28+
pages: write
29+
id-token: write
30+
31+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
32+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
33+
concurrency:
34+
group: "pages"
35+
cancel-in-progress: false
36+
37+
jobs:
38+
# Build job
39+
build:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v3
45+
46+
- name: Install Node.js
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: 18
50+
51+
- uses: pnpm/action-setup@v2
52+
name: Install pnpm
53+
id: pnpm-install
54+
with:
55+
version:
56+
run_install: false
57+
58+
- name: Get pnpm store directory
59+
id: pnpm-cache
60+
shell: bash
61+
run: |
62+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
63+
64+
- uses: actions/cache@v3
65+
name: Setup pnpm cache
66+
with:
67+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
68+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
69+
restore-keys: |
70+
${{ runner.os }}-pnpm-store-
71+
72+
- name: Install dependencies
73+
run: pnpm install
74+
75+
- name: Setup Pages
76+
uses: actions/configure-pages@v3
77+
with:
78+
static_site_generator: next
79+
- name: Build with Next.js
80+
run: pnpm next build
81+
- name: Static HTML export with Next.js
82+
run: pnpm next export
83+
- name: Upload artifact
84+
uses: actions/upload-pages-artifact@v1
85+
with:
86+
path: ./out
87+
88+
# Deployment job
89+
deploy:
90+
environment:
91+
name: github-pages
92+
url: ${{ steps.deployment.outputs.page_url }}
93+
runs-on: ubuntu-latest
94+
needs: build
95+
steps:
96+
- name: Deploy to GitHub Pages
97+
id: deployment
98+
uses: actions/deploy-pages@v2

.github/workflows/nextjs-deploy.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)