-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): configure deployment preview for the docs site on opened…
… pull requests
- Loading branch information
1 parent
5e835ca
commit d058bec
Showing
1 changed file
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# .github/workflows/preview.yml | ||
name: Deploy PR previews | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
# TODO: do we still want to run these on dependabot/non-human branches? | ||
deploy-preview-docs: | ||
if: github.event.action != 'closed' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Copied from a section of release-docs-and-schema.yml | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: 'yarn' | ||
node-version: latest | ||
|
||
- name: Install NPM dependencies | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Prebuild website | ||
run: yarn presite | ||
|
||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./site | ||
destination: ./_site | ||
# End copy from a section of release-docs-and-schema.yml | ||
|
||
- name: Deploy preview and post github comment | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./_site/ | ||
|
||
cleanup-preview-docs: | ||
if: github.event.action == 'closed' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Cleanup pr-preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./_site/ |