34 lines
746 B
YAML
34 lines
746 B
YAML
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:
|
|
paths:
|
|
- _site/
|
|
expire_in: 1 week
|
|
|
|
Deploy:
|
|
image: alpine
|
|
stage: deploy
|
|
before_script:
|
|
- 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'
|
|
script:
|
|
- lftp sftp://fainsil:DUMMY@ftp.perso.bde.inp-toulouse.fr -e "mirror -e -R _site www_public --exclude content ; quit"
|