forked from sef-global/sef-site
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
170ed90
commit 7139cf9
Showing
2 changed files
with
26 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,9 @@ | ||
language: java | ||
sudo: true | ||
matrix: | ||
include: | ||
# Build the project using maven | ||
- script: | ||
- mvn install | ||
# Deploy PR to surge | ||
- script: bash ./surge_deploy.sh |
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,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; |