-
Notifications
You must be signed in to change notification settings - Fork 43
51 lines (47 loc) · 1.59 KB
/
deploy_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
50
51
name: Deploy preview
on:
pull_request:
permissions:
contents: read
pages: write
id-token: write
deployments: write
jobs:
deploy:
name: Build and deploy
uses: primer/.github/.github/workflows/deploy_preview.yml@main
with:
node_version: 18
install: npm ci --no-audit --no-fund --ignore-scripts && npm run install:storybook
build: npm run build:tokens && npm run build && npm run build:next && cd docs/storybook && npm run build:preview
output_dir: docs/public
post_storybook:
needs: deploy
name: Link storybook
runs-on: ubuntu-latest
permissions:
deployments: write
steps:
- uses: chrnorm/deployment-action@v2
name: Post deployment url
id: deployment
with:
token: '${{ secrets.GITHUB_TOKEN }}'
environment-url: ${{needs.deploy.outputs.deployment_url}}/storybook
environment: storybook-preview
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
environment-url: ${{needs.deploy.outputs.deployment_url}}/storybook
state: 'success'
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
environment-url: ${{needs.deploy.outputs.deployment_url}}/storybook
state: 'failure'
deployment-id: ${{ steps.deployment.outputs.deployment_id }}