64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
kind: pipeline
|
|
name: hugo build and deploy
|
|
type: docker
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
trigger:
|
|
branch:
|
|
- prod
|
|
|
|
steps:
|
|
|
|
# BUILD
|
|
- name: build hugo site
|
|
image: hugomods/hugo:0.111.3
|
|
settings:
|
|
hugo_version: 0.111.3
|
|
extended: true
|
|
validate: true
|
|
config: config.toml
|
|
content: content
|
|
output: ./public
|
|
commands:
|
|
- hugo --minify
|
|
|
|
# PUSH FILES TO SERVER
|
|
- name: deploy files on server
|
|
image: drillster/drone-rsync
|
|
settings:
|
|
hosts: ["192.168.1.130"]
|
|
port:
|
|
from_secret: WEBHOSTING_PORT
|
|
target: /var/www/html/ltqf
|
|
source: public/*
|
|
user:
|
|
from_secret: WEBHOSTING_USER
|
|
key:
|
|
from_secret: WEBHOSTING_PRIVATE_KEY
|
|
|
|
# SEND MAIL NOTIF
|
|
- name: notify
|
|
image: drillster/drone-email
|
|
settings:
|
|
from.address: contact@legaragenumerique.fr
|
|
host: mail.gandi.net
|
|
port: 465
|
|
debug: true
|
|
username: contact@legaragenumerique.fr
|
|
password:
|
|
from_secret: MAIL_PASSWORD
|
|
recipients: [ contact@legaragenumerique.fr ]
|
|
subject: >
|
|
[{{ build.status }}]
|
|
{{ repo.owner }}/{{ repo.name }}
|
|
body: >
|
|
📝 {{repo.name}} / {{commit.branch}} - {{commit.message}} <br />
|
|
{{#success build.status}}
|
|
✅ succeeded for 👷♂️ build {{build.number}}
|
|
{{else}}
|
|
🛑 failed for 👷♂️ build {{build.number}}
|
|
{{/success}}
|
|
<br /><img src='https://www.legaragenumerique.fr/wp-content/uploads/2019/10/logo-web-garage_numerique.png'/>
|
|
when:
|
|
status: [ success, failure ] |