更新 deploy.yaml
This commit is contained in:
parent
c1a16b8587
commit
fd99ceb16b
@ -0,0 +1,60 @@
|
|||||||
|
name: deploying-doc
|
||||||
|
run-name: Deploying doc — ${{ gitea.run_id }}
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: 30 04 * * 1,4
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 🚚 Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
name: 🔧Install pnpm
|
||||||
|
with:
|
||||||
|
version: 9
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: 🔧Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: 🔧Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- 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
|
Loading…
x
Reference in New Issue
Block a user