Skip to content

PR Preview

PR Preview #5282

Workflow file for this run

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}}