From 7acb7c05b2eefc3c9b185874e1eb9a657f962beb Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 15 Mar 2021 11:40:14 +0100 Subject: [PATCH] ci: add .drone.yml --- .drone.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f052280 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,86 @@ +--- +kind: pipeline +type: docker +name: pull + +clone: + disable: true + +trigger: + event: + exclude: [push, pull_request] + +steps: +- name: fedora-hugo + pull: always + image: immawanderer/fedora-hugo:latest + commands: + - uname -r + - cat /etc/fedora-release + +--- +kind: pipeline +type: docker +name: build + +platform: + os: linux + arch: amd64 + +trigger: + branch: master + event: [push, pull_request] + +depends_on: +- pull + +steps: +- name: hugo-extended + pull: if-not-exists + image: immawanderer/fedora-hugo:latest + commands: + - git submodule init + - git submodule update + - hugo version + - hugo --gc=true --minify + +--- +kind: pipeline +name: notifications + +platform: + os: linux + arch: amd64 + +clone: + disable: true + +trigger: + branch: master + event: [push, tag, pull_request] + status: [success, failure] + +depends_on: [build] + +steps: + - name: discord + pull: if-not-exists + image: appleboy/drone-discord:latest + settings: + message: > + {{#success build.status}} + ✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded. + event: **`{{build.event}}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + {{else}} + ❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed. + event: **`${DRONE_BUILD_EVENT}`** + failed stage(s): **`${DRONE_FAILED_STAGES}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + ```{{commit.message}}``` + {{/success}} + webhook_id: + from_secret: discord_webhook_id + webhook_token: + from_secret: discord_webhook_token +