add github actions #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
jobs: | |
ci-cd: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ vars.NODE_VERSION }} | |
cache: npm | |
cache-dependency-path: 'package-lock.json' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@zuhlke' | |
- name: Install Root | |
run: | | |
npm ci | |
- name: Lint | |
run: | | |
npm run lint | |
- name: Check | |
run: | | |
npm run check | |
- name: Test | |
run: | | |
npm run test | |
- name: Build | |
run: | | |
npm run build | |
- name: Build Storybook | |
env: | |
NODE_OPTIONS: '--max-old-space-size=5120' | |
run: | | |
npm run build-storybook --workspace web-components | |
- name: Publish to Chromatic | |
uses: chromaui/action@v1 | |
with: | |
projectToken: ${{ secrets.CHROMATIC_TOKEN }} | |
exitOnceUploaded: true | |
onlyChanged: true | |
workingDir: web-components | |
storybookBuildDir: storybook-static | |
zip: true | |
- name: Bump Version | |
if: github.event_name == 'pull_request' | |
run: | | |
npm run version:patch | |
git config --global user.name 'Version Bumper' | |
git commit -am "Bump Patch" | |
git push | |
- name: Publish | |
if: github.event_name == 'pull_request' | |
run: | | |
npm publish --workspaces --access public |