chore: update workflow (#322)

This commit is contained in:
acbin
2025-04-23 20:24:48 +08:00
committed by GitHub
parent a9ceacbe42
commit ade569af28

View File

@@ -8,7 +8,6 @@ on:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
@@ -19,9 +18,6 @@ jobs:
with:
node-version: 22
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
@@ -29,14 +25,27 @@ jobs:
- name: Build with VitePress
run: npm run docs:build
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v4
- name: Generate CNAME
run: echo "java.doocs.org" > docs/.vitepress/dist/CNAME
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
target_branch: gh-pages
build_dir: docs/.vitepress/dist
fqdn: java.doocs.org
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: docs/.vitepress/dist
deploy:
needs: docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github_pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
build:
runs-on: ubuntu-latest
@@ -49,4 +58,4 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
source-repo: git@github.com:doocs/advanced-java.git
destination-repo: git@gitee.com:Doocs/advanced-java.git
destination-repo: git@gitee.com:Doocs/advanced-java.git