-
Notifications
You must be signed in to change notification settings - Fork 11
77 lines (63 loc) · 2.33 KB
/
publish-chromatic.js.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This workflow is for deploying Storybook to Chromatic qol.development@smartservice.qld.gov.au account, it will consume CHROMATIC_PROJECT_TOKEN in Github secrets.
# Further details on Chromatic setup: https://www.chromatic.com/docs/github-actions
name: Publish Chromatic
on:
push:
branches-ignore:
- 'gh-pages' # 👈 Excludes the gh-pages branch
# - 'master' # 👈 Excludes the master branch
concurrency:
group: compile-${{ github.workflow }}-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18' ]
name: Build and test on Node ${{ matrix.node }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'npm'
always-auth: 'true'
registry-url: 'https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/'
- name: npmrc
run: |
npm -v
node -v
cat /home/runner/work/_temp/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NEXUSREADONLY2NPMTOKEN }}
- name: Install #run on lint step (Which is cached)
run: | # Install packages
npm install --prefer-offline --no-audit --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NEXUSREADONLY2NPMTOKEN }}
# `npm rebuild` will run all those post-install scripts for us.
- name: rebuild and prepare
run: npm rebuild && npm run prepare --if-present
- name: Build
run: |
npm run build
- name: Test 🔧
run: |
npm run test-ci
- name: Test release 🔧
run: |
npm run test-release
- name: Publish to Chromatic
if: ${{ github.actor != 'dependabot[bot]' }}
uses: chromaui/action@v1
# Options required to the GitHub Chromatic Action
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
token: ${{ secrets.GH_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: "storybook-static"