Skip to content

fix: rename to index.scss so rollup builds Tab CSS #2976

fix: rename to index.scss so rollup builds Tab CSS

fix: rename to index.scss so rollup builds Tab CSS #2976

Workflow file for this run

name: Build and deploy Storybook
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node.js version
uses: actions/setup-node@v3.2.0
with:
node-version: "16"
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
version: 8.3
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
pnpm ls --recursive
- name: run linters
run: |
pnpm run lint:css
pnpm run lint:package
pnpm run lint:js
pnpm run lint:prettier
- name: build library
run: pnpm run build:library
- name: typecheck storybook
run: pnpm run typecheck:storybook
- name: build storybook
run: pnpm run build:storybook
- name: Upload storybook
uses: actions/upload-artifact@v3
with:
name: storybook
path: storybook-static
- name: Publish to Chromatic
uses: chromaui/action@v1
if: github.event.pull_request.draft == false
with:
autoAcceptChanges: main
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook-static
deploy-storybook:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download storybook artifact
uses: actions/download-artifact@v3
with:
name: storybook
path: storybook-static
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.3.4
with:
branch: gh-pages
folder: storybook-static
publish-npm:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ADMIN_TOKEN }}
- name: Set up Node.js version
uses: actions/setup-node@v3.2.0
with:
node-version: "16"
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
version: 8.3
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
pnpm ls --recursive
- name: build library
run: pnpm run build
- name: lerna version
env:
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: "NL Design System"
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: "NL Design System"
run: |
git push --set-upstream origin HEAD
pnpm run release
- name: lerna publish
env:
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_ACCESS_TOKEN}"
pnpm config set access public
pnpm run publish
pnpm config delete "//registry.npmjs.org/:_authToken"