image: node:current-alpine3.13 stages: - build - deploy before_script: - apk update - apk add --no-cache lftp openssh - mkdir -p ~/.ssh - echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts - echo "$FRONTEND_ENV" > .env npm build: stage: build only: - main script: - npm ci - npm run build artifacts: paths: - build lftp deploy: stage: deploy only: - main script: - lftp -e "set net:timeout 5; set net:max-retries 3; set net:reconnect-interval-base 5; open sftp://$SFTP_HOST; user $SFTP_USER $SFTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose build/ /httpdocs/map; bye"