Skip to content

add github actions

add github actions #5

Workflow file for this run

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 }}
fetch-depth: 0
- 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: Publish to Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
exitOnceUploaded: true
onlyChanged: true
workingDir: web-components
autoAcceptChanges: main
zip: true
- name: Bump Version
if: github.event_name != 'pull_request'
run: |
npm run version:patch
git config --global user.name 'Version Bumper'
git config --global user.email '[email protected]'
git commit -am "Bump Patch"
git push
- name: Publish
if: github.event_name != 'pull_request'
run: |
npm publish --workspaces --access public