2020-10-21 18:45:19 +02:00
|
|
|
stages:
|
2020-10-21 18:42:07 +02:00
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
image: node
|
|
|
|
script:
|
|
|
|
- echo "Start building App"
|
2020-11-26 19:18:03 +01:00
|
|
|
- yarn
|
|
|
|
- CI= yarn run build
|
2020-10-21 18:42:07 +02:00
|
|
|
- echo "Build successfully!"
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 hour
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
- node_modules/
|
|
|
|
|
|
|
|
deploy_production:
|
2020-11-26 19:18:03 +01:00
|
|
|
stage: deploy
|
2020-11-30 21:54:23 +01:00
|
|
|
before_script:
|
|
|
|
- apt-get update
|
|
|
|
- apt-get --yes --force-yes install rsync
|
2020-11-26 19:18:03 +01:00
|
|
|
script:
|
2020-11-30 21:54:23 +01:00
|
|
|
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
2020-11-26 19:18:03 +01:00
|
|
|
- echo "Deploying to server"
|
2020-11-30 21:54:23 +01:00
|
|
|
- rsync --progress -r build/* --delete website@wmi-frontend.plannaplan.pl:/var/www/plannaplan.pl
|
2020-11-26 19:18:03 +01:00
|
|
|
- echo "Deployed"
|
|
|
|
only:
|
|
|
|
- master
|