This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: StoryBook | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
release: | ||
types: | ||
- created | ||
|
||
pull_request: | ||
|
||
env: | ||
SKIP_PREFLIGHT_CHECK: true | ||
|
||
jobs: | ||
build-storybook: | ||
name: Build Storybook | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: node-modules-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: | | ||
npm ci --no-audit | ||
- name: Launch build | ||
run: | | ||
npm run build-storybook -- --quiet | ||
- name: Archive storybook artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: storybook-static | ||
path: | | ||
/home/runner/work/terra-front/terra-front/storybook-static/ | ||
deploy-storybook: | ||
name: Deploy StoryBook | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
needs: [build-storybook] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download storybook artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: storybook-static | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install netlify cli | ||
run: | | ||
npm i -g netlify-cli | ||
- name: Deploy storybook | ||
run: | ||
npx netlify deploy | ||
--site=${{ secrets.NETLIFY_SITE_ID }} | ||
--auth=${{ secrets.NETLIFY_ACCESS_TOKEN }} | ||
--dir=./storybook-static | ||
--message "${{ github.sha }} ${{ github.ref_name }}" | ||
--prod |