From 82e7a1f2994f8d90e5d10534a6e462d049aebb64 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 1 Jun 2021 22:21:29 -0500 Subject: [PATCH] Add docs build pipeline to drone config --- .drone.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/.drone.yml b/.drone.yml index a0f03af..0d171a1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,3 +1,86 @@ +kind: pipeline +type: docker +name: docs +steps: + # ============ BUILD STEPS =============== + - name: build documentation + image: glmdev/node-pnpm:latest + commands: + - pnpm i --silent + - pnpm docs:build + - cd docs && tar czf ../extollo_api_documentation.tar.gz www + + # =============== DEPLOY STEPS =============== + - name: copy artifacts to static host + image: appleboy/drone-scp + settings: + host: + from_secret: docs_deploy_host + username: + from_secret: docs_deploy_user + key: + from_secret: docs_deploy_key + port: 22 + source: extollo_api_documentation.tar.gz + target: /var/nfs/general/static/sites/extollo + when: + event: promote + target: docs + + - name: deploy artifacts on static host + image: appleboy/drone-ssh + settings: + host: + from_secret: docs_deploy_host + username: + from_secret: docs_deploy_user + key: + from_secret: docs_deploy_key + port: 22 + script: + - cd /var/nfs/general/static/sites/extollo + - rm -rf docs + - tar xzf extollo_api_documentation.tar.gz + - rm -rf extollo_api_documentation.tar.gz + - mv www docs + when: + event: promote + target: docs + + # =============== BUILD NOTIFICATIONS =============== + - name: send build success notifications + image: plugins/webhook + settings: + urls: + from_secret: notify_webhook_url + content_type: application/json + template: | + { + "title": "Drone-CI [extollo/docs @ ${DRONE_BUILD_NUMBER}]", + "message": "Build & deploy completed successfully.", + "priority": 4 + } + when: + status: success + event: + - promote + + - name: send build error notifications + image: plugins/webhook + settings: + urls: + from_secret: notify_webhook_url + content_type: application/json + template: | + { + "title": "Drone-CI [extollo/docs @ ${DRONE_BUILD_NUMBER}]", + "message": "Documentation build failed!", + "priority": 6 + } + when: + status: failure +--- + kind: pipeline name: default type: docker