-
Notifications
You must be signed in to change notification settings - Fork 221
59 lines (51 loc) · 2.14 KB
/
canary.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
59
name: Canary
on:
push:
branches:
- prerelease/*
workflow_dispatch: # Allow manual triggering of this job in case of failures
jobs:
canary:
runs-on: ubuntu-latest
steps:
## First, we'll checkout the repository. We don't persist credentials because we need a
## Personal Access Token to push on a branch that is protected. See
## https://github.com/cycjimmy/semantic-release-action#basic-usage
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0 # Used for conventional commit ranges
- uses: Workday/canvas-kit-actions/install@v1
with:
node_version: 16.x
## Build Storybook and extract component stories for Storybook aggregation. This will be used
## for Chromatic rebaselining and publishing to GH Pages. Should be before `yarn build` since
## built assets mess up this command
- name: Build Storybook
run: |
yarn build-storybook --quiet
yarn sb extract docs docs/stories.json
## Build for packaging.
- name: Build
run: yarn build
## Publish prerelease to npm. Must be run after a build
- name: Publish
run: node utils/publish-canary.mjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_CI_PUBLISH_TOKEN}}
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
BUILD_URL:
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
## Create a Chromatic baseline auto-accepting changes. Chromatic changes are already accepted
## in PRs, so we don't need to manually approve them here again. This new baseline will be
## used for future PRs. New PRs may show extra Chromatic changes until the "Update Branch"
## button is used in PRs which will pull this new baseline.
- name: Update Chromatic Baseline
uses: chromaui/action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_APP_CODE }}
storybookBuildDir: docs
exitOnceUploaded: true
exitZeroOnChanges: true
autoAcceptChanges: true