diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml new file mode 100644 index 0000000..9c927f1 --- /dev/null +++ b/.github/workflows/pr-preview.yml @@ -0,0 +1,22 @@ +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 + custom-url: log.javazero.top 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 账户