.gitlab-ci.yml 615 Bytes
Newer Older
rinpatch's avatar
rinpatch committed
1
stages:
rinpatch's avatar
rinpatch committed
2
- fetch-and-build
rinpatch's avatar
rinpatch committed
3 4 5 6 7 8 9
- deploy

variables:
  BRANCH: "develop"

image: alpine:latest

rinpatch's avatar
rinpatch committed
10 11
fetch-and-build:
 stage: fetch-and-build
rinpatch's avatar
rinpatch committed
12 13
 artifacts:
   paths:
rinpatch's avatar
rinpatch committed
14
   - site/
rinpatch's avatar
rinpatch committed
15
 script:
rinpatch's avatar
rinpatch committed
16 17 18
 - apk add git python3
 - python3 -m ensurepip
 - pip3 install mkdocs mkdocs-material
rinpatch's avatar
rinpatch committed
19
 - ./manage.sh all --branch $BRANCH
rinpatch's avatar
rinpatch committed
20 21 22 23

deploy:
  stage: deploy
  script:
24 25 26 27 28 29
  - apk update && apk add openssh-client rsync
  - mkdir -p ~/.ssh
  - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
  - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" site "${SSH_USER_HOST_LOCATION}/${BRANCH}"