diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bd464ec..0bf6a9b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,9 +6,8 @@ on: workflow_dispatch: jobs: - docs: + build: 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,24 +25,24 @@ 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 "schunter.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: schunter.doocs.org - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + path: docs/.vitepress/dist - build: + deploy: + needs: build runs-on: ubuntu-latest - if: github.repository == 'doocs/source-code-hunter' - needs: docs + permissions: + pages: write + id-token: write + environment: + name: github_pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - name: Sync to Gitee - uses: wearerequired/git-mirror-action@master - env: - SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} - with: - source-repo: git@github.com:doocs/source-code-hunter.git - destination-repo: git@gitee.com:Doocs/source-code-hunter.git \ No newline at end of file + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4