-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI for deploying pull request previews (#10)
- Loading branch information
1 parent
c2af895
commit 232ff8b
Showing
3 changed files
with
47 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,44 @@ | ||
name: Deploy pull request preview | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
concurrency: preview-${{ github.ref }} | ||
jobs: | ||
pr-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
submodules: true | ||
# Build the website | ||
- name: Use Node.js 20 | ||
if: github.event.action != 'closed' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Build | ||
if: github.event.action != 'closed' | ||
run: | | ||
npm ci | ||
npm run build | ||
env: | ||
THEOPLAYER_LICENSE: ${{ vars.THEOPLAYER_LICENSE }} | ||
# Preview URLs look like this: https://[owner].github.io/[repo]/pr-preview/pr-[number]/ | ||
# https://github.com/marketplace/actions/deploy-pr-preview | ||
DOCUSAURUS_BASE_URL: /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/ | ||
# Prevent PR previews from being indexed by search engines | ||
DOCUSAURUS_NO_INDEX: 1 | ||
# Deploy preview | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./build/ | ||
preview-branch: gh-pages | ||
umbrella-dir: pr-preview |
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