---
kind: pipeline
type: docker
name: build and deploy the poweronoff.click hugo
trigger:
  branch:
    - master
clone:
  disable: true    

steps:
- name: clone
  image: plugins/git
  recursive: true

- name: build
  image: plugins/hugo
  settings:
    hugo_version: 0.87.0
    validate: true
    buildDrafts: false
    buildExpired: false
    buildFuture: false
  
- name: deploy
  image: appleboy/drone-scp
  settings:
    host: poweronoff.click
    target: /var/www/poweronoff.click
    source: public/*
    rm: true
    strip_components: 1
    username:
      from_secret: ssh_username
    password:
      from_secret: ssh_password
    port:
      from_secret: ssh_port
  when:
    branch:
      - master
    event:
      exclude:
        - pull_request

- name: "send telegram notification"
  image: appleboy/drone-telegram
  settings:
    to: 733452136
    token: "986857118:AAFN9uAhYl_0WMYUE6hWGPoLArjjBBPxDnM"      
