Skip to content

Commit

Permalink
ci(web-client): add job for publishing Storybook to Chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
PiDelport committed Jul 1, 2021
1 parent 79f9153 commit 74099e6
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/web-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,42 @@ jobs:
# The production build takes longer, so do this last.
- name: Build (prod)
run: npm run build:prod

chromatic:

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # See https://www.chromatic.com/docs/github-actions#support-for-codeactionscheckoutv2code

# Docs: https://github.com/actions/setup-node#v2
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: "16"

# Docs:
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
# https://github.com/actions/cache/blob/main/examples.md#node---npm
- name: Cache (NPM)
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies (NPM)
run: npm ci

# TODO: Factor out the steps above, somehow.

# Docs: https://www.chromatic.com/docs/github-actions
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
workingDir: web-client
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

0 comments on commit 74099e6

Please sign in to comment.