92 lines
2.2 KiB
YAML
92 lines
2.2 KiB
YAML
---
|
|
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
- name: build-draft
|
|
image: plugins/hugo
|
|
settings:
|
|
hugo_version: 0.99
|
|
validate: true
|
|
buildDrafts: true
|
|
buildExpired: true
|
|
buildFuture: true
|
|
theme: geeklab
|
|
when:
|
|
branch: [ draft ]
|
|
event: [ push ]
|
|
|
|
- name: build
|
|
image: plugins/hugo
|
|
settings:
|
|
hugoVersion: 0.53
|
|
validate: true
|
|
theme: geeklab
|
|
when:
|
|
branch: [ master ]
|
|
event: [ push ]
|
|
|
|
- name: freeze
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
key:
|
|
from_secret: ssh_key
|
|
script:
|
|
- cp -R /var/www/virtual/geeklab/html/geeklabor.de/ /var/www/virtual/geeklab/html/geeklabor_freeze/
|
|
- ln -sfn /var/www/virtual/geeklab/html/geeklabor_freeze /var/www/virtual/geeklab/geeklabor.de
|
|
when:
|
|
branch: [ master ]
|
|
event: [ push ]
|
|
|
|
- name: publish
|
|
image: appleboy/drone-scp
|
|
settings:
|
|
source: public/*
|
|
target: /var/www/virtual/geeklab/html/geeklabor.de/
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
key:
|
|
from_secret: ssh_key
|
|
strip_components: 1
|
|
rm: true
|
|
when:
|
|
branch: [ master ]
|
|
event: [ push ]
|
|
|
|
- name: cleanup
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
key:
|
|
from_secret: ssh_key
|
|
script:
|
|
- ln -sfn /var/www/virtual/geeklab/html/geeklabor.de /var/www/virtual/geeklab/geeklabor.de
|
|
- rm -rf /var/www/virtual/geeklab/html/geeklabor_freeze/
|
|
when:
|
|
branch: [ master ]
|
|
event: [ push ]
|
|
|
|
- name: notify
|
|
image: plugins/matrix
|
|
settings:
|
|
homeserver: https://matrix.rknet.org
|
|
roomid: MtidqQXWWAtQcByBhH:rknet.org
|
|
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
|
|
password:
|
|
from_secret: matrix_password
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|