-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from eodash/preview-docs
add PR preview concept
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# .github/workflows/preview.yml | ||
# This is a basic workflow takes care of building and deploying | ||
# client when creating merge request | ||
|
||
name: Deploy PR previews | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed # pr-preview-action will do cleanup here, but build steps can be skipped | ||
|
||
# do not allow running multiple of pipelines for this PR in parallel | ||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
pages: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- uses: actions/checkout@v4 | ||
- if: github.event.action != 'closed' | ||
run: | | ||
npm install | ||
npm run docs:build -- --base /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/ | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: .vitepress/dist/ |