wochenbericht-manager/.gitlab-ci.yml

33 lines
791 B
YAML

stages:
- build
image: node:12.7.0
build:
stage: build
only:
- master
tags:
- prod
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- npm cache clean --force
- rm -rf node_modules
- npm install --save
script:
- npm run build
- export SSH_U=$(echo $SSH_USER)
- export SSH_S=$(echo $SSH_SERVER)
- export c=$PWD
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SSH_U@$SSH_S 'rm -rf $HOME/wbm/*'
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r $c/build/* $SSH_U@$SSH_S:/home/$SSH_U/wbm
artifacts:
paths:
- build
environment:
name: production
url: https://wbm.lucajaents.ch