diff --git a/.drone.starlark b/.drone.starlark index c0a644417..1ae2f7eca 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -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/**' + ] + } + } diff --git a/.drone.yml b/.drone.yml index da439c322..b84041b0d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 + ...