-
Notifications
You must be signed in to change notification settings - Fork 80
49 lines (49 loc) · 1.65 KB
/
pr-preview.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
39
40
41
42
43
44
45
46
47
48
49
name: PR Preview
on:
workflow_run:
workflows: [PR Build]
types:
- completed
jobs:
pr-preview:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: haya14busa/action-workflow_run-status@v1
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Download Docs Artifact
id: download-docs
uses: dawidd6/action-download-artifact@v2
with:
name: docs
path: dist/docs
workflow: ${{github.event.workflow_run.workflow_id}}
run_id: ${{github.event.workflow_run.id}}
if_no_artifact_found: ignore
- name: Download Coverage Artifact
id: download-coverage
uses: dawidd6/action-download-artifact@v2
with:
name: coverage
path: dist/docs/coverage
workflow: ${{github.event.workflow_run.workflow_id}}
run_id: ${{github.event.workflow_run.id}}
if_no_artifact_found: ignore
- name: Get PR Event
id: get-pr-event
if: ${{steps.download-docs.outputs.found_artifact == 'true'}}
uses: potiuk/get-workflow-origin@v1_5
with:
token: ${{secrets.GITHUB_TOKEN}}
sourceRunId: ${{github.event.workflow_run.id}}
- name: Deploy Docs Preview
if: ${{steps.download-docs.outputs.found_artifact == 'true'}}
timeout-minutes: 5
env:
NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
run: npx netlify-cli deploy --site storybook-clarity-design --alias ${{steps.get-pr-event.outputs.pullRequestNumber}}