You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
762 B

stages:
- build
build_frontend:
stage: build
image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build
before_script:
- echo "${DEPLOY_ENV_KEY}" > /workdir/deploy_key
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- cp -r Frontend/src/ /workdir/src/
- cp -r Frontend/public/ /workdir/public/
script:
- pwd
- ls -la
- cd /workdir
- npm run build
- ls -la /workdir/build
- ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "mkdir -p /opt/serve/"
- ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET -i /workdir/deploy_key "rm -rf /opt/serve/*"
- rsync --progress -av -e "ssh -i /workdir/deploy_key" /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/opt/serve/