From fbfafc914cfb0df724397fc3164da5a8cc2d40d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AE=E5=AD=90=E8=80=97=E8=80=97?= <3116737282@qq.com> Date: Sat, 26 Apr 2025 08:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20deploy.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yaml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index e69de29..7c6f5b8 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -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