stages:
- build
- deploy
Build:
image: node:alpine
stage: build
before_script:
- yarn config set cache-folder .yarn
- yarn install
script:
- yarn run build
cache:
paths:
- node_modules/
- .yarn
artifacts:
- _site/
expire_in: 1 week
Deploy:
image: alpine
stage: deploy
- apk add openssh-client lftp
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- lftp sftp://fainsil:DUMMY@ftp.perso.bde.inp-toulouse.fr -e "mirror -e -R _site www_public --exclude content ; quit"