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.

39 lines
925 B

  1. stages:
  2. - build
  3. - deploy
  4. build-website:
  5. image: sothr.com/hugo:0.54.0
  6. stage: build
  7. variables:
  8. HUGO_THEME: "pure"
  9. HUGO_BASEURL: "https://sothr.com"
  10. script:
  11. - /run.sh
  12. - tar -czvf website.tgz -C /output/ .
  13. only:
  14. - master
  15. tags:
  16. - linux
  17. artifacts:
  18. paths:
  19. - website.tgz
  20. deploy-website:
  21. image: sothr.com/deploy:ubuntu
  22. stage: deploy
  23. variables:
  24. TARGET_DIRECTORY: "/srv/www/sothr.com"
  25. script:
  26. - eval `ssh-agent -s`
  27. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  28. - mkdir -p ~/.ssh
  29. - ssh-keyscan -p $DEPLOY_PORT sothr.com >> ~/.ssh/known_hosts
  30. - mkdir /tmp/deploy
  31. - tar -xvf website.tgz -C /tmp/deploy
  32. - 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
  33. only:
  34. - master
  35. tags:
  36. - docker
  37. environment: production