Add docs build pipeline to drone config
This commit is contained in:
parent
4849016784
commit
82e7a1f299
83
.drone.yml
83
.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
|
||||
|
Loading…
Reference in New Issue
Block a user