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

Commit 2ebddea

Browse files
committed
refactor: Restructure deploy workflow to separate build and deployment steps
1 parent f505366 commit 2ebddea

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ on:
55
branches:
66
- docs
77

8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
813
jobs:
9-
deploy:
14+
build:
1015
runs-on: ubuntu-latest
1116
steps:
12-
- name: Checkout repo
17+
- name: Checkout repository
1318
uses: actions/checkout@v3
1419

1520
- name: Set up Node.js
@@ -23,10 +28,21 @@ jobs:
2328
- name: Build project
2429
run: npm run build
2530

31+
- name: Upload artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: ./dist
35+
36+
deploy:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
steps:
43+
- name: Configure GitHub Pages
44+
uses: actions/configure-pages@v5
45+
2646
- name: Deploy to GitHub Pages
27-
env:
28-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
run: |
30-
git config --global user.name "github-actions[bot]"
31-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
32-
npm run deploy
47+
id: deployment
48+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)