Skip to content

PR Preview

PR Preview #205

Workflow file for this run

name: PR Preview
on:
workflow_run:
workflows: [PR Build]
types:
- completed
jobs:
pr-preview:
name: PR Preview
if: ${{github.event.workflow_run.conclusion == 'success'}}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Install Dependencies
run: npm ci
- name: Download Storybook Artifact
uses: dawidd6/action-download-artifact@v2
with:
name: storybook
path: projects/core/dist/storybook/
workflow: ${{github.event.workflow_run.workflow_id}}
run_id: ${{github.event.workflow_run.id}}
- name: Get PR Event
id: get_pr_event
uses: potiuk/get-workflow-origin@v1_1
with:
token: ${{secrets.GITHUB_TOKEN}}
sourceRunId: ${{github.event.workflow_run.id}}
- name: Deploy Storybook Preview
continue-on-error: true
timeout-minutes: 5
env:
NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}}
NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}}
run: npx netlify deploy --filter core-ws --alias ${{steps.get_pr_event.outputs.pullRequestNumber}}