From 7bd38bfd087dbd46a9117afabb589f1aa760250f Mon Sep 17 00:00:00 2001 From: Kagol Date: Wed, 4 Feb 2026 19:56:00 +0800 Subject: [PATCH] ci: add deploy-github --- .github/workflows/deploy-github.yml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/deploy-github.yml diff --git a/.github/workflows/deploy-github.yml b/.github/workflows/deploy-github.yml new file mode 100644 index 00000000..fb643cf6 --- /dev/null +++ b/.github/workflows/deploy-github.yml @@ -0,0 +1,52 @@ +name: Deploy to github.io + +on: + push: + branches: [ dev, main ] # 设置源码主分支 + workflow_dispatch: {} # 支持手动触发 + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + - name: Install deps + run: pnpm -F tiny-pro-vue i + - name: Build site + run: pnpm -F tiny-pro-vue build + env: + VITE_BASE: /tiny-pro/ + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./template/tinyvue/dist + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4