Skip to content

Commit

Permalink
Feat: Publish Storybook in CI (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherPHolder committed Oct 2, 2023
2 parents 6dd7c3c + cbd4a9d commit 984210e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,33 @@ jobs:
- name: Build Affected
run: npx nx affected --target=build --parallel=3

publish-storybook:
name: Publish Storybook
needs: [build, lint, test]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: Cache NPM Dependencies
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache
dist
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

- name: Publish Storybook Affected
run: npx nx affected --target=publish-storybook --parallel=3 --project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }}

deploy-front-end:
name: Deploy Front-End
needs: [build, lint, test]
Expand Down
10 changes: 9 additions & 1 deletion libs/ui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@
"quiet": true
}
}
},
"publish-storybook": {
"executor": "nx:run-commands",
"dependsOn": ["build-storybook"],
"options": {
"parallel": false,
"commands": ["npx chromatic -d ./dist/storybook/ui --exit-zero-on-changes"]
}
}
},
"tags": []
"tags": ["frontend"]
}
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@typescript-eslint/parser": "5.60.1",
"@vitest/coverage-c8": "0.32.0",
"@vitest/ui": "0.32.0",
"chromatic": "^7.2.0",
"cypress": "^13.0.0",
"esbuild": "^0.19.2",
"eslint": "8.46.0",
Expand Down

0 comments on commit 984210e

Please sign in to comment.