Skip to content

Commit

Permalink
Deploy storybook site to production (#1439)
Browse files Browse the repository at this point in the history
* adds out* to gitignore

* adds command to build and deploy storybook

* adds lock

* adds build to circleCI

* cd client

* why webpack

* build static

* adds webpack

* update

* fetches the translations first

* first build then deploy

* global

* locales

* --ci

* no need for build :)

* gitignore

* surge

* yml

* cd client

* new job deploy-storybook

* rm storybook job

* rm job

* adds job

* adds whole job

* requires

* typo

* job

* adds defaults

* sudo

* with ruby

* with ruby

* cleans job

* sudo

* commands

* npm is in

* ache

* tmp

* same to build

* builds only from master

* and reverts

* and cleans

* only master

* ifme.surge.sh
  • Loading branch information
paschalidi authored and julianguyen committed Apr 11, 2019
1 parent 7ebcb76 commit e0b8e36
Show file tree
Hide file tree
Showing 4 changed files with 2,521 additions and 372 deletions.
42 changes: 42 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,42 @@ jobs:
name: Deploy Master to Heroku
command: |
git push https://heroku:[email protected]/ifme.git master
deploy-storybook:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/ifmeorg/ifme/tmp
- run:
working_directory: ~/ifmeorg/ifme
command: rm -f ifmeorg/ifme/.rvmrc; echo 2.6.0 > ifmeorg/ifme/.ruby-version; rvm use 2.6.0 --default
- run:
working_directory: ~/ifmeorg/ifme
command: nvm install 11.10.1 && nvm alias default 11.10.1
- restore_cache:
keys:
- v1-dep-{{ .Branch }}-
- v1-dep-master-
- v1-dep-
- run: gem install bundler
- run: bundle install --path=vendor/bundle --jobs=4 --retry=3
- run: rm -rf ~/.yarn
- run: npm i -g yarn
- run: yarn install
- run:
name: Deploy Storybook
command: |
cd client
yarn build:storybook
mv .out .public
yarn run surge --project .public --domain ifme.surge.sh
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.cache/yarn
- ./node_modules
- ./vendor/bundle

workflows:
version: 2
build-test:
Expand Down Expand Up @@ -173,3 +209,9 @@ workflows:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+/
- deploy-storybook:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+/
2 changes: 2 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ translations.js
default.js
/coverage
/storybook-static
/.out*/*
/.public*/*
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build:production": "yarn build:i18n && NODE_ENV=production webpack --config webpack.config.js",
"build:development": "yarn build:i18n && NODE_ENV=development webpack -w --config webpack.config.js",
"build:production:debug": "yarn build:production --display-modules --sort-modules-by size",
"build:storybook": "npm run build:i18n && build-storybook -c .storybook -o .out",
"lint:flow": "flow",
"lint:eslint": "eslint 'app/**/*.js' 'app/**/*.jsx'",
"lint:prettier": "./node_modules/.bin/prettier \"app/**/*.{js,jsx}\" --write --single-quote --trailing-comma all",
Expand Down Expand Up @@ -95,6 +96,7 @@
"prettier-eslint": "^8.8.2",
"react-test-renderer": "^16.5.2",
"sass-loader": "^7.1.0",
"surge": "^0.20.3",
"uglifyjs-webpack-plugin": "^2.0.1",
"url-loader": "^1.1.1",
"webpack": "^4.19.1",
Expand Down
Loading

0 comments on commit e0b8e36

Please sign in to comment.