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 1cab94a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .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,16 +38,33 @@ 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
id-token: write
environment:
name: github-pages
name: pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- 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: pages/preview
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: docs/.vitepress/dist
preview-branch: main
umbrella-dir: docs/pre

0 comments on commit 1cab94a

Please sign in to comment.