You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

37 lines
941 B

  1. stages:
  2. - build
  3. - deploy
  4. build-website:
  5. image: sothr.com/hugo:0.54.0
  6. stage: build
  7. script:
  8. - /usr/local/sbin/hugo --theme pure --destination /output --baseURL https://sothr.com
  9. - TARGET=$PWD
  10. - tar -czvf website.tgz -C /output/ .
  11. only:
  12. - master
  13. tags:
  14. - linux
  15. artifacts:
  16. paths:
  17. - website.tgz
  18. deploy-website:
  19. image: sothr.com/deploy:ubuntu
  20. stage: deploy
  21. variables:
  22. TARGET_DIRECTORY: "/srv/www/sothr.com"
  23. script:
  24. - eval `ssh-agent -s`
  25. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  26. - mkdir -p ~/.ssh
  27. - ssh-keyscan -p $DEPLOY_PORT sothr.com >> ~/.ssh/known_hosts
  28. - mkdir /tmp/deploy
  29. - tar -xvf website.tgz -C /tmp/deploy
  30. - rsync -avz --delete-delay -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $DEPLOY_PORT" --progress /tmp/deploy/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  31. only:
  32. - master
  33. tags:
  34. - docker
  35. environment: production