Skip to content

Commit 0e75fd0

Browse files
authored
chore: update workflow
1 parent bfc2f5f commit 0e75fd0

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

.github/workflows/deploy.yml

+18-21
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
docs:
9+
build:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
@@ -18,34 +18,31 @@ jobs:
1818
with:
1919
node-version: 22
2020
cache: npm
21-
22-
- name: Setup Pages
23-
uses: actions/configure-pages@v4
2421

2522
- name: Install dependencies
2623
run: npm ci
2724

2825
- name: Build with VitePress
2926
run: npm run docs:build
3027

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

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

0 commit comments

Comments
 (0)