From d4a0e10cc3c90b6ccebbcb0b1816ce7a7dfcd8de Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Mon, 9 Dec 2024 14:06:18 -0300 Subject: [PATCH 1/2] github: action: Prepare current actions to accept page-preview --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f82de62fc..5243f736e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,11 +52,13 @@ jobs: bun run build - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.5 + uses: JamesIves/github-pages-deploy-action@v4.7.2 if: success() && github.event_name != 'pull_request' with: branch: gh-pages folder: dist + clean-exclude: pr-preview/ + force: false deploy-electron: needs: test From 59dfec601b1b05ab78f30e4d5be05f91f9684469 Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Mon, 9 Dec 2024 14:06:40 -0300 Subject: [PATCH 2/2] github: action: Add page-preview --- .github/workflows/preview.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 000000000..ba866c4dd --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,34 @@ +name: Deploy PR previews +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed +concurrency: preview-${{ github.ref }} +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup Bun + if: github.event.action != 'closed' + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - name: Build and check + if: github.event.action != 'closed' + run: | + bun install --frozen-lockfile + bun run build + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./dist + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto