Skip to content

Commit

Permalink
Ci/chromatic (#98)
Browse files Browse the repository at this point in the history
* ci(workflows): enhance Chromatic workflow and update deployment configurations

* fix(packages/viewer): update controlsOptions to disable auto-rotate in Default story

* ci(workflows): update Storybook build command to use npx nx for chromatic workflow

* ci(workflows): update Chromatic workflow to use Ubuntu 20.04 and set publishing environment
  • Loading branch information
Schlomoh authored Nov 6, 2024
1 parent 0691583 commit 50875b6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/chromatic-vctrl-viewer.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,49 @@
name: Publish vctrl/viewer Storybook to Chromatic

on:
push:
branches:
- main
#exclude dependabot and renovate branches
on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-chromatic
cancel-in-progress: true

permissions:
actions: write
contents: read

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-22.04
name: Chromatic
runs-on: ubuntu-20.04
environment: chromatic-publishing

steps:
- name: Checkout code
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
cache: npm
cache-dependency-path: ./package.json
node-version: 20

- name: Install dependencies
run: npm ci
- name: 📥 Install deps
run: npm install

- name: Build Storybook
run: npx nx build-storybook vctrl/viewer

- name: Run Chromatic
- name: Run chromatic
uses: chromaui/action@latest
# Chromatic GitHub Action options
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN_1 }}
workingDir: packages/viewer
autoAcceptChanges: 'main'
exitZeroOnChanges: true
exitOnceUploaded: true
onlyChanged: true
skip: '@(renovate/**|dependabot/**)'
4 changes: 4 additions & 0 deletions .github/workflows/deploy-official-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- 'package*.json'
- '.github/workflows/deploy-official-website.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GCR_HOSTNAME: gcr.io
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
Expand Down
2 changes: 1 addition & 1 deletion packages/viewer/src/vectreal-viewer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
cameraOptions: defaultCameraOptions,
controlsOptions: defaultControlsOptions,
controlsOptions: { ...defaultControlsOptions, autoRotate: false },
envOptions: defaultEnvOptions,
gridOptions: defaultGridOptions,
infoPopoverOptions: defaultInfoPopoverProps,
Expand Down

0 comments on commit 50875b6

Please sign in to comment.