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.

22 lines
752 B

stages:
- build
build_frontend:
stage: build
image: registry.gitlab.com/fia72-dev/eva_lernsituation/frontend-build
before_script:
- ssh-add <(echo "${DEPLOY_ENV_KEY}")
- mkdir -p ~/.ssh
- '[[ -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 "mkdir -p /home/$DEPLOY_ENV_USER/serve"
- ssh $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET "rm -rf /home/$DEPLOY_ENV_USER/serve/*"
- rsync --progress -av -e ssh /workdir/build $DEPLOY_ENV_USER@$DEPLOY_ENV_TARGET:/home/$DEPLOY_ENV_USER/serve