accounts-frontend/.travis.yml

70 lines
1.7 KiB
YAML

language: node_js
node_js:
- "11"
cache:
yarn: true
directories:
- node_modules
addons:
ssh_known_hosts: account.ely.by
env:
global:
- GA_ID=UA-45299905-3
- SENTRY_CDN="https://95461d4ce6734b088c34fc4272d0a9e6@sentry.io/1463318"
- VERSION="${TRAVIS_TAG:-${TRAVIS_BRANCH}-${TRAVIS_COMMIT:0:7}}"
- FORCE_COLOR=1
script:
- yarn ci:check
- yarn build:quiet
before_deploy:
# Prepare ssh deployment
- openssl aes-256-cbc -K $encrypted_dd5ad7a5f201_key -iv $encrypted_dd5ad7a5f201_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
# Removing unneeded files
- rm -rf dist/messages
- rm -rf dist/*.css.map
# Move all source maps to it's own directory
- mkdir -p source-maps
- mv dist/*.js.map source-maps/ 2>/dev/null; true
- cp dist/*.js source-maps/
# Creating tar.gz and zip archives
- cd dist
- tar -zcf ../dist.tar.gz --exclude="*.map" *
- zip -rq ../dist.zip * -x "*.map"
- cd ..
deploy:
- provider: releases
api_key: "$GITHUB_TOKEN"
file:
- dist.tar.gz
- dist.zip
skip_cleanup: true
draft: true
on:
branch: master
# - provider: script
# skip_cleanup: true
# script: echo "put -r $TRAVIS_BUILD_DIR/dist/* accounts-frontend/" | sftp deploy@account.ely.by
# on:
# branch: master
- provider: script
skip_cleanup: true
script: >
curl -sL https://sentry.io/get-cli/ | bash &&
sentry-cli releases new -p $SENTRY_PROJECT $VERSION &&
sentry-cli releases set-commits --auto $VERSION &&
sentry-cli releases files $VERSION upload-sourcemaps source-maps &&
sentry-cli releases deploys $VERSION new -e "Production"
on:
branch: master