Skip to content

Commit

Permalink
ci: Deploy PR as temporary page
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Jul 11, 2024
1 parent cfb0aa5 commit 7d28667
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ name: CI

on:
workflow_dispatch:
pull_request:
push:
schedule:
# Run every 6 days to help us stay on our toes
- cron: '0 0 */6 * *'
# Required for write permission in a PR
pull_request_target:
branches: ["master"]

permissions:
id-token: write
pages: write

jobs:
test:
Expand Down Expand Up @@ -35,6 +41,13 @@ jobs:
xvfb-run --auto-servernum bun test:ci
deploy-page:
environment:
name: 'Pages Preview'
url: ${{ steps.preview_deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
needs: test
runs-on: ubuntu-latest
steps:
Expand All @@ -51,14 +64,28 @@ 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/[email protected]
if: success() && github.event_name != 'pull_request'
with:
branch: gh-pages
folder: dist

- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

- name: Upload artifact for preview
# 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
with:
preview: 'true'

deploy-electron:
needs: test
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 7d28667

Please sign in to comment.