From 1c088d968ff077d48751e6a334552f013232e17f Mon Sep 17 00:00:00 2001 From: JavaZero <71128095+JavaZeroo@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:39:37 +0800 Subject: [PATCH 1/2] Add PR preview workflow --- .github/workflows/pr-preview.yml | 21 +++++++++++++++++++++ README.md | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/pr-preview.yml diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 0000000..3f0ac0c --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,21 @@ +name: Build PR Preview + +on: + pull_request: + types: [opened, reopened, synchronize, closed] + +permissions: + contents: write + pull-requests: write + +concurrency: ci-${{ github.ref }} + +jobs: + build-deploy-and-preview: + name: Build, Deploy to GitHub Pages and Deploy PR Preview + runs-on: ubuntu-latest + steps: + - name: Build, Deploy to GitHub Pages and Deploy PR Preview + uses: chvmvd/build-deploy-and-preview-action@v1.2.0 + with: + type: vite diff --git a/README.md b/README.md index 1af44f6..eebfc38 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ 本项目采用 GitHub Actions 自动化部署到 GitHub Pages,每次推送到主分支时自动构建和部署。 +同时,每个 Pull Request 都会自动构建并生成预览页面,方便审核。 + 如需 fork 此项目进行自定义开发: 1. Fork 本仓库到你的 GitHub 账户 From acda4fe0ac6afd8fbe83b49c58672dcf4aadb5ac Mon Sep 17 00:00:00 2001 From: JavaZero <71128095+JavaZeroo@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:03:31 +0800 Subject: [PATCH 2/2] Specify custom domain for PR previews --- .github/workflows/pr-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 3f0ac0c..9c927f1 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -19,3 +19,4 @@ jobs: uses: chvmvd/build-deploy-and-preview-action@v1.2.0 with: type: vite + custom-url: log.javazero.top