safe-react/scripts/github/deploy_pull_request.sh
Daniel Sanchez 870509eecf
Migrate to GitHub actions (#1924)
* Add Github action for each network environment

* Disable travis build

* Move deploy scripts to new folder

* Adapt deploy scripts to Github actions

* Run coveralls only if tests succeed

* Upload sentry source map

* Add Production flag for tagged builds

* Use coveralls Github Action

* Add debug steps to all networks for first release test
2021-02-24 17:24:25 +01:00

22 lines
603 B
Bash

#!/bin/bash
function deploy_pull_request {
# Pull request number with "pr" prefix
PULL_REQUEST_NUMBER="pr$PR_NUMBER"
# Only alphanumeric characters. Example safe-react -> safereact
REVIEW_FEATURE_FOLDER="$REPO_NAME_ALPHANUMERIC/$PULL_REQUEST_NUMBER"
# App build path
APP_PATH="./build"
# Deploy pull request
aws s3 sync $APP_PATH s3://${REVIEW_BUCKET_NAME}/${REVIEW_FEATURE_FOLDER}/${REACT_APP_NETWORK}/app --delete
}
# Only:
# - Pull requests
# - Security env variables are available. PR from forks don't have them.
if [ -n "$AWS_ACCESS_KEY_ID" ]; then
deploy_pull_request
fi