-
Notifications
You must be signed in to change notification settings - Fork 1.2k
58 lines (52 loc) · 1.64 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
52
53
54
55
56
57
58
name: Deploy
on:
pull_request:
permissions:
contents: write
pages: write
id-token: write
deployments: write
issues: write
statuses: write
checks: write
jobs:
deploy:
if: ${{ github.repository == 'primer/css' }}
uses: primer/.github/.github/workflows/deploy_preview.yml@main
name: Deploy preview
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
node_version: 18
install: npm ci && cd docs && npm ci && cd ..
build: npm run build:docs:preview
output_dir: docs/public
deploy-storybook:
if: ${{ github.repository == 'primer/css' }}
name: Preview Storybook
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/checkout@v3
- uses: chrnorm/[email protected]
name: Create GitHub deployment for storybook
id: storybook
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: Storybook Preview
environment_url: '${{ needs.deploy.outputs.deployment_url }}/storybook'
- name: Update storybook deployment status (success)
if: success()
uses: chrnorm/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment-url: '${{ needs.deploy.outputs.deployment_url }}/storybook'
state: 'success'
deployment-id: ${{ steps.storybook.outputs.deployment_id }}
- name: Update storybook deployment status (failure)
if: failure()
uses: chrnorm/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
state: 'failure'
deployment-id: ${{ steps.storybook.outputs.deployment_id }}