Skip to content

Commit 6c2663f

Browse files
authored
chore: update workflow
1 parent 69b9502 commit 6c2663f

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

.github/workflows/deploy.yml

+18-22
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
docs:
9+
build:
1010
runs-on: ubuntu-latest
11-
1211
steps:
1312
- uses: actions/checkout@v4
1413
with:
@@ -19,34 +18,31 @@ jobs:
1918
with:
2019
node-version: 22
2120
cache: npm
22-
23-
- name: Setup Pages
24-
uses: actions/configure-pages@v4
2521

2622
- name: Install dependencies
2723
run: npm ci
2824

2925
- name: Build with VitePress
3026
run: npm run docs:build
3127

32-
- name: Deploy to GitHub Pages
33-
uses: crazy-max/ghaction-github-pages@v4
28+
- name: Generate CNAME
29+
run: echo "dsa.doocs.org" > docs/.vitepress/dist/CNAME
30+
31+
- name: Upload artifact
32+
uses: actions/upload-pages-artifact@v3
3433
with:
35-
target_branch: gh-pages
36-
build_dir: docs/.vitepress/dist
37-
fqdn: dsa.doocs.org
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
path: docs/.vitepress/dist
4035

41-
build:
36+
deploy:
37+
needs: build
4238
runs-on: ubuntu-latest
43-
if: github.repository == 'doocs/data-structure-and-algorithm'
44-
needs: docs
39+
permissions:
40+
pages: write
41+
id-token: write
42+
environment:
43+
name: github_pages
44+
url: ${{ steps.deployment.outputs.page_url }}
4545
steps:
46-
- name: Sync to Gitee
47-
uses: wearerequired/git-mirror-action@master
48-
env:
49-
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
50-
with:
51-
source-repo: [email protected]:doocs/data-structure-and-algorithm.git
52-
destination-repo: [email protected]:Doocs/data-structure-and-algorithm.git
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)