Skip to content

Commit ade569a

Browse files
authored
chore: update workflow (#322)
1 parent a9ceacb commit ade569a

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

.github/workflows/deploy.yml

+21-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
jobs:
99
docs:
1010
runs-on: ubuntu-latest
11-
1211
steps:
1312
- uses: actions/checkout@v4
1413
with:
@@ -19,24 +18,34 @@ 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 "java.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: java.doocs.org
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
path: docs/.vitepress/dist
35+
36+
deploy:
37+
needs: docs
38+
runs-on: ubuntu-latest
39+
permissions:
40+
pages: write
41+
id-token: write
42+
environment:
43+
name: github_pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4
4049

4150
build:
4251
runs-on: ubuntu-latest
@@ -49,4 +58,4 @@ jobs:
4958
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
5059
with:
5160
source-repo: git@github.com:doocs/advanced-java.git
52-
destination-repo: git@gitee.com:Doocs/advanced-java.git
61+
destination-repo: git@gitee.com:Doocs/advanced-java.git

0 commit comments

Comments
 (0)