Skip to content

Commit

Permalink
Configure surge auto-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jayasanka-sack authored and Piumal1999 committed Jan 15, 2020
1 parent 170ed90 commit 7139cf9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: java
sudo: true
matrix:
include:
# Build the project using maven
- script:
- mvn install
# Deploy PR to surge
- script: bash ./surge_deploy.sh
17 changes: 17 additions & 0 deletions scripts/surge_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Not a PR. Skipping surge deployment"
exit 0
fi
# Check if the travis credentials exists
if [ -z "$SURGE_LOGIN" ] || [ -z "$SURGE_TOKEN" ]; then
echo "Surge credentials not set. Skipping surge deployment"
exit 0
fi
# Install surge
npm i -g surge
cd src/main/webapp
# Create a domain to the PR
export DEPLOY_DOMAIN=https://pr-${TRAVIS_PULL_REQUEST}-sef-site.surge.sh
# Upload to surge.sh
surge --project ./build --domain $DEPLOY_DOMAIN;

0 comments on commit 7139cf9

Please sign in to comment.