Skip to content

Commit

Permalink
Fixes#610 Auto deployment using Surge (fossasia#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthS007 authored and mariobehling committed Dec 7, 2017
1 parent 8d14101 commit 8f8f6f6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ script:

after_success:
- bash <(curl -s https://codecov.io/bash)
- bash ./pr_deploy.sh
- bash ./deploy.sh

cache:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ $ npm install

**Note:** Please make sure that you comment the *StoreDevtools* `import` again before making the PR.

### For deploying with [Surge](https://surge.sh/):

Surge will automatically generate deployment link whenever a pull request passes Travis CI.

Suppose pull request number is 150 and it passes Travis CI. The deployment link can be found here: `https://pr-150-fossasia-LoklakSearch.surge.sh`

### For deploying with [Github Pages](https://pages.github.com/):
With these very simple steps you can have loklak_search deployed:
* **Step 1:** Fork loklak_search repository and clone it to your desktop
Expand Down
14 changes: 14 additions & 0 deletions pr_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Not a PR. Skipping surge deployment"
exit 0
fi

npm i -g surge

export [email protected]
# Token of a dummy account.
export SURGE_TOKEN=d1c28a7a75967cc2b4c852cca0d12206

export DEPLOY_DOMAIN=https://pr-${TRAVIS_PULL_REQUEST}-fossasia-LoklakSearch.surge.sh
surge --project ./dist --domain $DEPLOY_DOMAIN;

0 comments on commit 8f8f6f6

Please sign in to comment.