This commit is contained in:
parent
142812d036
commit
da2cd6f864
1 changed files with 71 additions and 0 deletions
71
.drone.yml
Normal file
71
.drone.yml
Normal file
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
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
|
||||
|
Loading…
Reference in a new issue