From cda84bf420565e7b2068478825cca87c379a30ec Mon Sep 17 00:00:00 2001 From: szhhwh <3116737282@qq.com> Date: Sat, 26 Apr 2025 21:27:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20dev.yaml=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitea/workflows/dev.yaml diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml new file mode 100644 index 0000000..e69de29 -- 2.34.1 From fe9181591f35d8f499abb1b5b6b6b1f2eab51f1e Mon Sep 17 00:00:00 2001 From: szhhwh <3116737282@qq.com> Date: Sat, 26 Apr 2025 21:29:35 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20deploy.yaml=EF=BC=8C?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=20pnpm=20=E7=89=88=E6=9C=AC=E8=87=B3=2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index fede8a9..1ae0a12 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -24,7 +24,7 @@ jobs: - uses: pnpm/action-setup@v4 name: 🔧Install pnpm with: - version: 9 + version: 10 run_install: false - name: 🔧Install Node.js -- 2.34.1 From 448cd955ac1fcd813da6ff1356b0bd21d8a1a642 Mon Sep 17 00:00:00 2001 From: szhhwh <3116737282@qq.com> Date: Sat, 26 Apr 2025 21:30:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20deploy.yaml=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=20Cloudflare=20Pages=20=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0=E4=B8=BA=20jingji-referenc?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 1ae0a12..d186544 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -44,4 +44,4 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy ./src/.vuepress/dist --project-name=jingji-tsreference-vue --branch=main + command: pages deploy ./src/.vuepress/dist --project-name=jingji-reference --branch=main -- 2.34.1 From 2bfb67399820869d18fbf79d174cdea7ebe08d0d Mon Sep 17 00:00:00 2001 From: szhhwh <3116737282@qq.com> Date: Sat, 26 Apr 2025 21:31:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20dev.yaml=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/dev.yaml | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index e69de29..4766c83 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -0,0 +1,74 @@ +name: Checking-doc +run-name: Checking doc — ${{ gitea.run_id }} +on: + workflow_dispatch: + pull_request: + types: [opened,synchronize] + +jobs: + check-file-changes: + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.filter.outputs.should_run }} + steps: + - name: 🚚 Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 📑 Check changed files + id: filter + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} || git diff --name-only HEAD~1 HEAD) + + IMPORTANT_FILE_CHANGED=false + for file in $CHANGED_FILES; do + if [[ $file =~ \.(ts|yaml|json|js|scss)$ ]]; then + IMPORTANT_FILE_CHANGED=true + break + fi + done + + if [ "$IMPORTANT_FILE_CHANGED" = true ]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + + build-and-deploy: + needs: check-file-changes + if: ${{ needs.check-file-changes.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - name: 🚚 Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@v4 + name: 🔧Install pnpm + with: + version: 10 + 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: 🚀 Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy ./src/.vuepress/dist --project-name=jingji-reference \ No newline at end of file -- 2.34.1