docs/.drone.yml
2024-01-09 09:58:26 +01:00

71 lines
1.5 KiB
YAML

kind: pipeline
name: hugo build and deploy
type: docker
platform:
os: linux
arch: amd64
trigger:
branch:
- main
steps:
# GIT PULL
- name: git pull submodules
image: alpine/git
settings:
user:
from_secret: GIT_USER
password:
from_secret: GIT_PASSWORD
commands:
- git submodule update --init --recursive
# BUILD
- name: build
# ARM version of mkDocs
# image: ghcr.io/afritzler/mkdocs-material:8.1.0
image: mkdocs-material:1.0
pull: if-not-exists
volumes:
- name: site
path: /drone/src/docs
commands:
- cd doc && pip install -r requirements.txt && mkdocs build
# PUSH FILES TO SERVER
- name: deploy files on server
image: drillster/drone-rsync
settings:
hosts: ["92.243.16.7"]
target: /var/www/html/mkdoc/site/
source: doc/*
port:
from_secret: RSYNC_SSH_PORT
user:
from_secret: RSYNC_USER
key:
from_secret: RSYNC_HOST_KEY
# TO CONFIG AND TEST - SEND MAIL NOTIF
- name: notify
image: drillster/drone-email
settings:
from.address: drone@legaragenumerique.fr
host: mail.gandi.net
port: 465
# skip_verify: true
debug: true
username: drone@legaragenumerique.fr
password:
from_secret: MAIL_PASSWORD
recipients: [ greg@legaragenumerique.fr ]
subject: >
[{{ build.status }}]
{{ repo.owner }}/{{ repo.name }}
({{ build.branch }} - {{ truncate build.commit 8 }})
attachment: build-result.xml
body:
https://git.io/vgvPz
when:
status: [ success, failure ]