Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,3 @@ jobs:
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN}}

build-and-deploy-sb:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install and Build
run: |
npm install
npm run deploy-storybook

- name: Deploy
with:
branch: gh-pages
folder: storybook-static # output folder from `npm run build-storybook`
52 changes: 52 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build & deploy

on:
pull_request:
branches:
- main
types: [closed]

jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 13.x

- name: Install NPM packages
run: npm ci

- name: Build project
run: npm run build-storybook

- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./storybook-static

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./storybook-static

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static