uci-doc/.drone.yml

171 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
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
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
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/heads/master
- 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: 3772b9da3de90c6cfddedbbcd9d20ef4888e03d48ceea6967603f54fe872cbb4
...