From ade569af283a4418f138d37c76716a5f58c903f6 Mon Sep 17 00:00:00 2001 From: acbin <44314231+acbin@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:24:48 +0800 Subject: [PATCH] chore: update workflow (#322) --- .github/workflows/deploy.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 32a0097..a39248f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 \ No newline at end of file + destination-repo: git@gitee.com:Doocs/advanced-java.git