.gitlab-ci.yml 736 Bytes
Newer Older
1
deploy:  
Florian Moser's avatar
Florian Moser committed
2
  image: composer:latest
3
4
  only:
    - master
5
  before_script:
Florian Moser's avatar
Florian Moser committed
6
    # download dependencies
Florian Moser's avatar
Florian Moser committed
7
8
9
    - composer install
  
    # setup SSH
10
11
12
13
14
15
16
    - apk add --update openssh-client bash
    - eval $(ssh-agent -s)
    - bash -c 'ssh-add <(echo "$DEPLOY_PRIVKEY")'
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - ssh-keyscan thealternative.ch >> ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts
17
  script:
Florian Moser's avatar
Florian Moser committed
18
    # update files with git
19
    - ssh thealt-website@thealternative.ch 'cd /home/thealt-website/website; git pull'
Florian Moser's avatar
Florian Moser committed
20
21
22
23
    
    # replace dependencies 
    - ssh thealt-website@thealternative.ch 'cd /home/thealt-website/website; rm -rf vendors'
    - scp -ra vendors thealt-website@thealternative.ch:/home/thealt-website/website