-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (43 loc) · 1.31 KB
/
preview.yml
File metadata and controls
49 lines (43 loc) · 1.31 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
45
46
47
48
49
# .github/workflows/preview.yml
# This is a basic workflow takes care of building and deploying
# catalog 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
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# do not allow running multiple of pipelines for this PR in parallel
concurrency: preview-${{ github.ref }}
env:
# BASE_URL for MyST build
BASE_URL: /pr-preview/pr-${{ github.event.number }}/tutorials
jobs:
deploy-preview:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install MyST
if: github.event.action != 'closed'
run: npm install -g mystmd
- name: Build MyST HTML Assets
if: github.event.action != 'closed'
run: myst build --html
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: _build/html/