kind: pipeline name: blog type: docker clone: depth: 1 steps: - name: restore_cache image: drillster/drone-volume-cache volumes: - name: go_module_cache path: /var/cache/go/mod/ settings: restore: true mount: - /root/go/pkg/mod/ - name: hugo_prod depends_on: - restore_cache image: code.ndumas.com/ndumas/hugo:latest commands: - hugo --enableGitInfo -d /drone/src/public/ --baseURL https://blog.ndumas.com when: branch: include: - main - name: hugo_dev depends_on: - restore_cache image: code.ndumas.com/ndumas/hugo commands: - hugo --enableGitInfo -d /drone/src/public/ --baseURL https://dev.blog.ndumas.com when: branch: include: - dev - name: hugo_drafts depends_on: - restore_cache image: code.ndumas.com/ndumas/hugo commands: - hugo --enableGitInfo -DF -d /drone/src/public/ --baseURL https://drafts.blog.ndumas.com when: branch: include: - drafts - name: publish_prod depends_on: - hugo_prod image: drillster/drone-rsync settings: key: from_secret: BLOG_DEPLOY_KEY user: blog delete: true recursive: true hosts: ["blog.ndumas.com"] source: /drone/src/public/ target: /var/www/blog.ndumas.com/ include: ["*"] when: branch: include: - main - name: publish_dev depends_on: - hugo_dev image: drillster/drone-rsync settings: key: from_secret: BLOG_DEPLOY_KEY user: blog delete: true recursive: true hosts: ["blog.ndumas.com"] source: /drone/src/public/ target: /var/www/dev.blog.ndumas.com/ include: ["*"] when: branch: include: - dev - name: publish_drafts depends_on: - hugo_drafts image: drillster/drone-rsync settings: key: from_secret: BLOG_DEPLOY_KEY user: blog delete: true recursive: true hosts: ["blog.ndumas.com"] source: /drone/src/public/ target: /var/www/drafts.blog.ndumas.com/ include: ["*"] when: branch: include: - drafts - name: rebuild_cache depends_on: - publish_prod - publish_dev - publish_drafts image: drillster/drone-volume-cache volumes: - name: go_module_cache path: /var/cache/go/mod/ settings: rebuild: true mount: - /root/go/pkg/mod/