Update package.json #4
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: Build, Deploy Storybook and Publish to NPM | |
on: | |
push: | |
branches: [main] | |
jobs: | |
# setup_build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Setup Node.js v16 | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: 16 | |
# - name: Install dependencies | |
# run: | | |
# if [ -e 'package-lock.json' ]; then | |
# npm ci | |
# else | |
# npm install | |
# fi | |
build_deploy_storybook: | |
# needs: setup_build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: | | |
if [ -e 'package-lock.json' ]; then | |
npm ci | |
else | |
npm install | |
fi | |
- name: Build Storybook | |
run: npm run build-storybook | |
- name: Deploy Storybook to GitHub Pages | |
uses: bitovi/[email protected] | |
with: | |
# Specifies if this action should checkout the code | |
checkout: # optional, default is true | |
# Specifies the path of the static assets after building | |
# optional, default is dist/storybook | |
path: docs | |
# Specifies the command to run after npm ci for the build | |
# deploy_storybook: | |
# needs: build_storybook | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v2 | |
# - name: Deploy to GitHub Pages | |
# uses: JamesIves/github-pages-deploy-action@v4 | |
# with: | |
# branch: gh-pages | |
# folder: docs | |
# token: ${{ secrets.GH_TOKEN }} | |
npm_publish: | |
# needs: setup_build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
- name: Setup Node.js v16 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: | | |
if [ -e 'package-lock.json' ]; then | |
npm ci | |
else | |
npm install | |
fi | |
- name: Build Library | |
run: npm run build-lib | |
- name: Build Styles | |
run: npm run build:styles | |
- name: Generate Tailwind Styles | |
run: npm run generate-css | |
- name: Publish to NPM | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |