stages: - build - deploy build: stage: build image: node script: - echo "Start building App" - echo "REACT_APP_API_URL=https://wmi-backend.plannaplan.pl" > .env - 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