Broken-by-Design/.drone.yml

72 lines
1.4 KiB
YAML
Raw Normal View History

2022-05-30 19:52:21 +00:00
---
kind: pipeline
type: docker
name: default
clone:
disable: true
steps:
- name: checkout
image: alpine/git
environment:
GITEA_TOK:
from_secret: GITEA_TOKEN
commands:
- echo "machine git.broken-by-design.fr login fmaury password $GITEA_TOK" > ~/.netrc
- git clone --recurse --depth 1 https://git.broken-by-design.fr/fmaury/website-build .
- mkdir -p content
- git clone -b $DRONE_COMMIT_BRANCH --depth 1 https://git.broken-by-design.fr/fmaury/Broken-by-Design content
when:
branch:
- master
- name: build
image: plugins/hugo
settings:
hugo_version: 0.99.1
when:
branch:
- master
- name: package
image: alpine
commands:
- tar -C public -czf public.tgz .
when:
branch:
- master
- name: publish
image: plugins/sftp:linux-amd64
settings:
host: www.broken-by-design.fr
username: dronehugo
password:
from_secret: ssh_password
port: 22
files: public.tgz
destination_path: /srv/website/dronehugo/
when:
branch:
- master
- name: deploy
image: appleboy/drone-ssh
settings:
host:
- www.broken-by-design.fr
username: dronehugo
password:
from_secret: ssh_password
port: 22
command_timeout: 2m
script:
- rm -rf /srv/website/dronehugo/public
- mkdir -p /srv/website/dronehugo/public
- tar -C /srv/website/dronehugo/public -xf /srv/website/dronehugo/public.tgz
when:
branch:
- master