Generate and publish documentation within drone
This commit is contained in:
+56
-3
@@ -10,7 +10,10 @@ def main(ctx):
|
||||
binary('windows'),
|
||||
]
|
||||
|
||||
after = manifest()
|
||||
after = [
|
||||
manifest(),
|
||||
documentation()
|
||||
]
|
||||
|
||||
for b in before:
|
||||
for s in stages:
|
||||
@@ -385,7 +388,7 @@ def binary(name):
|
||||
}
|
||||
|
||||
def manifest():
|
||||
return [{
|
||||
return {
|
||||
'kind': 'pipeline',
|
||||
'type': 'docker',
|
||||
'name': 'manifest',
|
||||
@@ -424,4 +427,54 @@ def manifest():
|
||||
'refs/tags/**'
|
||||
]
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
def documentation():
|
||||
return {
|
||||
'kind': 'pipeline',
|
||||
'type': 'docker',
|
||||
'name': 'documentation',
|
||||
'platform': {
|
||||
'os': 'linux',
|
||||
'arch': 'amd64',
|
||||
},
|
||||
'steps': [
|
||||
{
|
||||
'name': 'generate',
|
||||
'image': 'webhippie/hugo:latest',
|
||||
'pull': 'always',
|
||||
'commands': [
|
||||
'make docs'
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'publish',
|
||||
'image': 'plugins/gh-pages:1',
|
||||
'pull': 'always',
|
||||
'settings': {
|
||||
'username': {
|
||||
'from_secret': 'github_username'
|
||||
},
|
||||
'password': {
|
||||
'from_secret': 'github_token'
|
||||
},
|
||||
'pages_directory': 'docs/public/',
|
||||
'temporary_base': 'tmp/',
|
||||
},
|
||||
'when': {
|
||||
'event': {
|
||||
'exclude': [
|
||||
'pull_request'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
'depends_on': [],
|
||||
'trigger': {
|
||||
'ref': [
|
||||
'refs/heads/master',
|
||||
'refs/pull/**'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+44
@@ -649,4 +649,48 @@ depends_on:
|
||||
- darwin
|
||||
- windows
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: documentation
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: generate
|
||||
pull: always
|
||||
image: webhippie/hugo:latest
|
||||
commands:
|
||||
- make docs
|
||||
|
||||
- name: publish
|
||||
pull: always
|
||||
image: plugins/gh-pages:1
|
||||
settings:
|
||||
pages_directory: docs/public/
|
||||
password:
|
||||
from_secret: github_token
|
||||
temporary_base: tmp/
|
||||
username:
|
||||
from_secret: github_username
|
||||
when:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
trigger:
|
||||
ref:
|
||||
- refs/heads/master
|
||||
- refs/pull/**
|
||||
|
||||
depends_on:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user