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.

40 lines
968 B

5 years ago
  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. - export HUGO_SOURCE="$PWD"
  12. - /run.sh --minify
  13. - tar -czvf website.tgz -C /output/ .
  14. only:
  15. - master
  16. tags:
  17. - docker
  18. artifacts:
  19. paths:
  20. - website.tgz
  21. deploy-website:
  22. image: sothr.com/deploy:ubuntu
  23. stage: deploy
  24. variables:
  25. TARGET_DIRECTORY: "/srv/www/sothr.com"
  26. script:
  27. - eval `ssh-agent -s`
  28. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  29. - mkdir -p ~/.ssh
  30. - ssh-keyscan -p $DEPLOY_PORT sothr.com >> ~/.ssh/known_hosts
  31. - mkdir /tmp/deploy
  32. - tar -xvf website.tgz -C /tmp/deploy
  33. - 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
  34. only:
  35. - master
  36. tags:
  37. - docker
  38. environment: production