hugo-theme-hilfe/.drone.yml
2020-02-17 09:22:50 +01:00

168 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/
- echo "${DRONE_TAG:-latest}" > VERSION
- 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*' --exclude='local*'
- name: checksum
image: alpine
commands:
- cd dist/ && sha256sum * > ../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
concurrency:
limit: 1
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/latest/download/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
image: appleboy/drone-ssh:1.5.5
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- cp -R /var/www/virtual/geeklab/html/geekdocs.de/ /var/www/virtual/geeklab/html/geekdocs_freeze/
- ln -sfn /var/www/virtual/geeklab/html/geekdocs_freeze /var/www/virtual/geeklab/geekdocs.de
username:
from_secret: ssh_username
- name: publish
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/geekdocs.de/
username:
from_secret: ssh_username
- name: cleanup
image: appleboy/drone-ssh:1.5.5
settings:
host:
from_secret: ssh_host
key:
from_secret: ssh_key
script:
- ln -sfn /var/www/virtual/geeklab/html/geekdocs.de /var/www/virtual/geeklab/geekdocs.de
- rm -rf /var/www/virtual/geeklab/html/geekdocs_freeze/
username:
from_secret: ssh_username
trigger:
ref:
- refs/tags/**
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: c783c5567b269aa5d7279a52edf2de39039e5366d6d2008d767b20725fa05462
...