frontend/.gitlab-ci.yml
Marcin Woźniak 3ae44b5bcf
Updated gitlab-ci
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2020-11-30 21:54:23 +01:00

35 lines
839 B
YAML

stages:
- build
- deploy
build:
stage: build
image: node
script:
- echo "Start building App"
- yarn
- CI= yarn run build
- echo "Build successfully!"
artifacts:
expire_in: 1 hour
paths:
- build
- node_modules/
deploy_production:
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"
- rsync --progress -r build/* --delete website@wmi-frontend.plannaplan.pl:/var/www/plannaplan.pl
- echo "Deployed"
only:
- master