-
Notifications
You must be signed in to change notification settings - Fork 27
44 lines (37 loc) · 1.17 KB
/
Copy pathpr-preview.yaml
File metadata and controls
44 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: "Deploy a PR preview to the gh-pages branch"
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
branches:
- 'master'
concurrency: preview-${{ github.ref }}
jobs:
deploy-pr-preview:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- name: Checkout the PR version of the website repository
uses: actions/checkout@v4
- name: Setup the environment
if: github.event.action != 'closed' # Skip the build if the PR has been closed; just run the clean up steps
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yaml
init-shell: bash
cache-environment: true
post-cleanup: none
- name: Build the PR version of the website
if: github.event.action != 'closed' # Skip the build if the PR has been closed; just run the clean up steps
run: quarto render
shell: bash -el {0} # Required to see the mamba init env
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./_site/