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.

38 lines
809 B

  1. stages:
  2. - build
  3. - deploy
  4. site-build:
  5. image: jojomi/hugo
  6. stage: build
  7. script:
  8. - hugo
  9. only:
  10. - master
  11. artifacts:
  12. paths:
  13. - public
  14. expire_in: 1 week
  15. tags:
  16. - docker
  17. site-deploy:
  18. image: panubo/sshd:latest
  19. stage: deploy
  20. variables:
  21. DEPLOY_USER: "deploy"
  22. DEPLOY_HOST: "162.243.78.94"
  23. DEPLOY_PORT: "9140"
  24. TARGET_DIRECTORY: "~/blog.nulloctet.com"
  25. script:
  26. - echo "Deployment To Production Starting..."
  27. - eval `ssh-agent -s`
  28. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  29. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress public/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  30. only:
  31. - master
  32. dependencies:
  33. - site-build
  34. tags:
  35. - docker
  36. environment: production