0.12.7 #114
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: Deploy and publish | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
FORCE_COLOR: 1 | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Install dependencies and build Storybook | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
- name: Install dependencies | |
run: npm install | |
- name: Build Storybook | |
run: npm run build:storybook | |
- name: Upload Storybook build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: storybook-build | |
path: storybook-static | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
name: Test components | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Storybook build | |
uses: actions/download-artifact@v3 | |
with: | |
name: storybook-build | |
path: storybook-static | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
- name: Install dependencies | |
run: npm install | |
- name: Install browsers | |
run: npx playwright install | |
- name: Run Storybook tests | |
run: npm run test:ci | |
publish_npm: | |
name: Publish UI library to npm | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm install | |
- name: Build UI library | |
run: npm run build | |
- name: Publish @sikaeducation/ui to npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
deploy_storybook: | |
name: Deploy Storybook | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Download Storybook build | |
uses: actions/download-artifact@v3 | |
with: | |
name: storybook-build | |
path: storybook-static | |
- name: Deploy Storybook to Netlify | |
uses: jsmrcaga/action-netlify-deploy@v2.0.0 | |
with: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_DEPLOY_MESSAGE: "Deploy v${{ github.ref }}" | |
NETLIFY_DEPLOY_TO_PROD: true | |
build_directory: storybook-static | |
build_command: echo "Build exists, skipping npm run build" | |
install_command: echo "Install exists, skipping npm install" | |
create_release: | |
name: Create release | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Publish release | |
uses: elgohr/Github-Release-Action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
title: Release |