kind: pipeline
name: default

steps:
    - name: build and deploy
      image: einar/jekyll
      pull: if-not-exists
      commands:
          - jekyll build --destination /tmp/build
          - rsync -rlpgoD /releases/ /tmp/build/releases/
          - rsync -rlpgoD /assets /tmp/build/
          - rsync -rlpgoD /tmp/build/ $WEBROOT/
      volumes:
          - name: sites
            path: /sites
          - name: releases
            path: /releases
          - name: assets
            path: /assets
          - name: docker_sock
            path: /var/run/docker.sock
      when:
          event:
              - push
      environment:
          WEBROOT: /sites/dennogumi.org

    - name: notify
      image: plugins/matrix
      settings:
          homeserver: https://conference.heavensinferno.net
          roomid: NMyHktzhNpctHWeJN
          accesstoken:
              from_secret: access_token
          userid: "@dimension_service:conference.heavensinferno.net"

volumes:
    - name: sites
      host:
          path: /srv/www/htdocs
    - name: releases
      host:
          path: /srv/releases
    - name: assets
      host:
          path: /srv/dennogumi-assets
    - name: docker_sock
      host:
          path: /var/run/docker.sock