Skip to content

Commit c04c5f4

Browse files
committed
构建CI
1 parent eeac1af commit c04c5f4

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Use Node.js 20
29+
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: "20.x"
33+
34+
- name: Build
35+
env:
36+
NODE_ENV: production
37+
run: |
38+
npm install
39+
npm run build
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
# Upload entire repository
46+
path: "./dist"
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4
50+
51+
- name: Deploy
52+
uses: peaceiris/actions-gh-pages@v4
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./dist
56+
publish_branch: build

0 commit comments

Comments
 (0)