Skip to content

Commit

Permalink
Add Pages Preview Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
knoppiks committed Nov 18, 2024
1 parent 2fba43f commit 8a588ed
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [ "opened", "reopened", "synchronize", "closed" ]
merge_group:

jobs:
Expand Down Expand Up @@ -37,8 +38,8 @@ jobs:
path: docs/.vitepress/dist

deploy:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-24.04
if: github.ref_name == github.event.repository.default_branch
needs: [ build ]
permissions:
pages: write
Expand All @@ -50,3 +51,21 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

preview:
runs-on: ubuntu-24.04
if: github.ref_name != github.event.repository.default_branch
needs: [ build ]
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: rossjrw/pr-preview-action@v1
if: github.ref_name != github.event.repository.default_branch
with:
source-dir: build
preview-branch: main
umbrella-dir: docs/pr-preview

0 comments on commit 8a588ed

Please sign in to comment.