Skip to content

Commit

Permalink
add script to deploy the webapp that uses the production server
Browse files Browse the repository at this point in the history
  • Loading branch information
simonedegiacomi committed Jun 12, 2019
1 parent 8b95cb6 commit 135920c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.


### `npm run deploy`
### `npm run deployDev` and `npm run deployProd`

Builds the app for production and the publish it on Github Pages.
Builds the app and then publishes it on Github Pages. The difference between the two commands is that `deployDev` builds
the app that will consume the APIs from the development server, while `deployProd` build the app that will use the production
server.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api-dev.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build",
"deploy": "gh-pages -d build"
"predeployDev": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api-dev.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build",
"predeployProd": "REACT_APP_SERVER_URL=\"https://crowdai-servant-api.herokuapp.com\" REACT_APP_WEBAPP_URL=\"https://trentocrowdai.github.io/servant-web\" npm run build",
"deployDev": "gh-pages -d build",
"deployProd": "gh-pages -d build"
},
"proxy": "http://localhost:3000",
"eslintConfig": {
Expand Down

0 comments on commit 135920c

Please sign in to comment.