合并两个job中的任务

This commit is contained in:
狮子耗耗 2025-04-26 12:44:42 +08:00
parent fd99ceb16b
commit 5395cffd2a

View File

@ -6,8 +6,11 @@ on:
- cron: 30 04 * * 1,4
jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: 🚚 Checkout
uses: actions/checkout@v4
@ -32,29 +35,9 @@ jobs:
- name: 🔴Build doc
run: pnpm run docs:build
- name: 📦 Upload artifact
uses: actions/upload-artifact@v4
with:
name: doc-files
path: ./src/.vuepress/dist/
retention-days: 1
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: ⬇️ Download artifact
uses: actions/download-artifact@v4
with:
name: doc-files
path: ./dist
- name: 🚀 Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./dist --project-name=jingji-spbook-vue
command: pages deploy ./src/.vuepress/dist --project-name=jingji-spbook-vue