hugo-geekdoc/.drone.yml

170 lines
3.4 KiB
YAML

---
kind: pipeline
name: build
platform:
os: linux
arch: amd64
steps:
- name: assets
image: node
commands:
- npm install -g gulp -s
- npm install -s
- gulp default
- name: test
image: klakegg/hugo:0.59.1-ext-alpine
commands:
- cd exampleSite/
- mkdir themes/ && ln -s ../../. themes/hugo-geekdoc && hugo-official
- name: build
image: alpine
commands:
- mkdir dist/
- tar -zcvf dist/hugo-geekdoc.tar.gz . --exclude='.git*' --exclude='.drone*' --exclude='dist' --exclude='.git*' --exclude='example*' --exclude='src' --exclude='gulp*' --exclude='package*' --exclude='node*'
- name: checksum
image: alpine
commands:
- cd dist/ && sha256sum * > ../sha256sum.txt
- cd ../ && ls -lh dist/
- cat sha256sum.txt
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- dist/*
- sha256sum.txt
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: docs
platform:
os: linux
arch: amd64
steps:
- name: assets
image: byrnedo/alpine-curl
commands:
- mkdir -p exampleSite/themes/hugo-geekdoc/
- curl -L https://github.com/xoxys/hugo-geekdoc/releases/download/v0.1.0/hugo-geekdoc.tar.gz | tar -xz -C exampleSite/themes/hugo-geekdoc/ --strip-components=1
- name: test
image: klakegg/hugo:0.59.1-ext-alpine
commands:
- cd exampleSite/ && hugo-official
- name: freeze
pull: always
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- cp -R /var/www/virtual/geeklab/html/docs.geeklabor.de/ /var/www/virtual/geeklab/html/docs_freeze/
- ln -sfn /var/www/virtual/geeklab/html/docs_freeze /var/www/virtual/geeklab/docs.geeklabor.de
username:
from_secret: ssh_username
- name: publish
pull: always
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
rm: true
source: exampleSite/public/*
strip_components: 2
target: /var/www/virtual/geeklab/html/docs.geeklabor.de/
username:
from_secret: ssh_username
- name: cleanup
pull: always
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- ln -sfn /var/www/virtual/geeklab/html/docs.geeklabor.de /var/www/virtual/geeklab/docs.geeklabor.de
- rm -rf /var/www/virtual/geeklab/html/docs_freeze/
username:
from_secret: ssh_username
trigger:
ref:
- refs/heads/master
depends_on:
- build
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: matrix
image: plugins/matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
trigger:
ref:
- refs/heads/master
- refs/tags/**
status:
- success
- failure
depends_on:
- build
- docs
---
kind: signature
hmac: 682a950289f296ee8f25875e689221b051cc796a364175b9c3b0e45d9972a4d6
...