1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
build:
  image: node:14-slim
  stage: build
  only:
    refs:
      - develop

  before_script:
    - npm ci

  script:
    - npm run build

  artifacts:
    expire_in: 3 mos
    paths:
      - dist/
deploy:
  image: alpine
  stage: deploy
  tags:
    - nas
  only:
    - develop

  before_script:
    - apk add --no-cache rsync openssh
    - mkdir -p ~/.ssh
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | ssh-add -
    - ssh-keyscan quantum.agroparistech.fr >> ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts

  script:
    - rsync -rav -O --no-perms --delete dist/*/ deployer@quantum.agroparistech.fr:/home/docker/prod/spoq/