From b4046b9b0e16ce2f36fb72896476b1e352cc011a Mon Sep 17 00:00:00 2001 From: Khac Vy Date: Wed, 5 Feb 2020 10:28:06 +0700 Subject: [PATCH] chore: #131 migrate elements github page --- .github/workflows/release-develop.yml | 51 +++++++++++++++++++++++++++ package.json | 5 +-- packages/elements/package.json | 1 + 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 63c132e27d..9969e26c60 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -68,3 +68,54 @@ jobs: - name: Release Develop run: | yarn release:dev --since origin/master^1 --parallel + + deploy_story_book: + runs-on: ubuntu-latest + steps: + - name: checks out repository to $GITHUB_WORKSPACE + uses: actions/checkout@v1 + + - name: Setup Node Environement + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Set up workspace experimental + run: | + yarn config set workspaces-experimental true + + - name: Install dependencies + run: | + yarn + + - name: Lint + run: | + yarn lint + + - name: Fetch config + run: | + yarn fetch-config + + - name: Build storybook + run: | + yarn build-storybook --since origin/master^1 --parallel + + - name: deploy story book to GH pages + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: $GITHUB_TOKEN + BASE_BRANCH: master # The branch the action should deploy from. + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: out # The folder the action should deploy. + diff --git a/package.json b/package.json index d7e757b5c2..ea962a929e 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,12 @@ "private": true, "scripts": { "build": "lerna run build:prod --parallel", - "test": "lerna run test:ci --parallel", - "lint": "eslint --ext=jsx,ts,tsx packages --fix", + "build-storybook": "lerna run build-storybook --parallel", "fetch-config": "yarn config-manager getSecret reapit-marketplace-app-config", + "lint": "eslint --ext=jsx,ts,tsx packages --fix", "release:dev": "lerna run release:dev --parallel", "release:prod": "lerna run release:prod --parallel", + "test": "lerna run test:ci --parallel", "test-e2e:ci": "lerna run test-e2e:ci --parallel" }, "dependencies": { diff --git a/packages/elements/package.json b/packages/elements/package.json index 36ebffccb7..941aa158c8 100644 --- a/packages/elements/package.json +++ b/packages/elements/package.json @@ -20,6 +20,7 @@ "module": "dist/elements.esm.js", "typings": "dist/index.d.ts", "scripts": { + "build-storybook": "build-storybook -o out", "build:prod": "rimraf dist && cross-env NODE_ENV=production tsdx build --format=cjs,esm,umd && rollup -c", "start:dev": "start-storybook -p 6006", "start:prod": "cross-env NODE_ENV=development tsdx watch",