diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ee1d92af..6377584b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,10 @@ on: # Run every 6 days to help us stay on our toes - cron: '0 0 */6 * *' +permissions: + id-token: write + pages: write + jobs: test: name: Test @@ -35,6 +39,9 @@ jobs: xvfb-run --auto-servernum bun test:ci deploy-page: + environment: + name: 'Pages Preview' + url: ${{ steps.preview_deployment.outputs.page_url }} needs: test runs-on: ubuntu-latest steps: @@ -51,6 +58,8 @@ jobs: run: | bun install --frozen-lockfile bun run build + # This will be used by the deployment PR action + cp -r dist ./_site - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.5 @@ -59,6 +68,22 @@ jobs: branch: gh-pages folder: dist + - name: Setup Pages + if: success() && github.event_name == 'pull_request' + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 + + - name: Upload artifact for preview + if: success() && github.event_name == 'pull_request' + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 + + - name: Deploy PR preview 🚀 + id: preview_deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 + if: success() && github.event_name == 'pull_request' + with: + preview: 'true' + deploy-electron: needs: test runs-on: ${{ matrix.os }}