-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (38 loc) · 1.04 KB
/
pr.yml
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
name: Deploy PRs
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
jobs:
Get-Base-Href:
runs-on: ubuntu-latest
steps:
- run: echo "base=/sam-design-system-site/pr-preview/pr-${{github.event.number}}/ >> $GITHUB_ENV"
Build-HTML:
needs: Get-Base-Href
if: github.event.action != 'closed'
uses: ./.github/workflows/build.yml
with:
base: ${{env.base}}
Deploy-HTML:
runs-on: ubuntu-latest
if: ${{ !failure() }}
needs: Build-HTML
steps:
# Only needed because rossjrw/pr-preview-action needs to run in a git repo
- name: Check out repository code
uses: actions/checkout@v4
- name: Download HTML Assets
# If closing PR, build will not occur so nothing to download
if: github.event.action != 'closed'
uses: actions/download-artifact@v4
with:
name: html-assets
path: ./docs
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/