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-12-08 19:08:16 +01:00
|
|
|
- echo "REACT_APP_API_URL=https://wmi-backend.plannaplan.pl" > .env
|
2020-11-26 23:13:22 +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 23:13:22 +01:00
|
|
|
stage: deploy
|
|
|
|
before_script:
|
|
|
|
- apt-get update
|
|
|
|
- apt-get --yes --force-yes install rsync
|
|
|
|
script:
|
|
|
|
- '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'
|
|
|
|
- echo "Deploying to server"
|
2020-11-26 23:15:42 +01:00
|
|
|
- rsync --progress -r build/* --delete website@wmi-frontend.plannaplan.pl:/var/www/plannaplan.pl
|
2020-11-26 23:13:22 +01:00
|
|
|
- echo "Deployed"
|
|
|
|
only:
|
|
|
|
- master
|