blog/.drone.yml

44 lines
1.3 KiB
YAML
Raw Normal View History

2020-04-11 18:01:23 +00:00
kind: pipeline
name: default
steps:
- name: prends_des_branches
image: alpine/git
commands:
- git submodule init
- git submodule update --recursive --remote
- name: construis_ton_nid
image: plugins/hugo
settings:
2022-02-04 10:49:26 +00:00
hugo_version: 0.92.0
2020-04-11 18:01:23 +00:00
extended: false
validate: true
# config: hugo/config.toml
# content: hugo/content
# layout: hugo/layout
# output: hugo/public
# theme: hugo/themes/hugo-theme-hello-friend-ng/
2022-02-04 07:42:32 +00:00
url: https://ewen.korr.bzh
2020-04-11 18:01:23 +00:00
2022-02-03 20:16:40 +00:00
- name: deploy
2022-02-03 20:13:02 +00:00
image: alpine/git
2022-02-03 20:10:42 +00:00
environment:
2022-02-03 20:19:55 +00:00
SCP_KEY:
2022-02-03 20:10:42 +00:00
from_secret: SCP_KEY
2022-02-03 20:19:55 +00:00
SCP_HOSTNAME:
2022-02-03 20:10:42 +00:00
from_secret: SCP_HOSTNAME
2022-02-03 20:19:55 +00:00
SCP_USER:
2022-02-03 20:10:42 +00:00
from_secret: SCP_USER
2022-02-03 20:19:55 +00:00
SCP_PORT:
2022-02-03 20:10:42 +00:00
from_secret: SCP_PORT
2022-02-04 04:57:12 +00:00
SCP_COMMAND:
from_secret: SCP_COMMAND
2022-02-03 20:10:42 +00:00
commands:
2022-02-03 20:17:13 +00:00
- mkdir $HOME/.ssh
2022-02-03 20:10:42 +00:00
- echo "$SCP_KEY" > $HOME/.ssh/id_rsa
2022-02-03 20:26:13 +00:00
- ssh-keyscan -t rsa -p $SCP_PORT $SCP_HOSTNAME >> $HOME/.ssh/known_hosts
2022-02-03 20:27:26 +00:00
- chmod -R og-rw $HOME/.ssh/
2022-02-04 07:21:54 +00:00
- scp -r -P $SCP_PORT -i $HOME/.ssh/id_rsa public $SCP_USER@$SCP_HOSTNAME:~/
2022-02-04 07:42:32 +00:00
- ssh -p $SCP_PORT -i $HOME/.ssh/id_rsa $SCP_USER@$SCP_HOSTNAME 'rm -rvf /srv/apps/blog/data/www/publcic/*; mv ~/public/* /srv/apps/blog/data/www/public/; docker-compose -f /srv/apps/blog/docker-compose.yml restart; rm -rvf ~/public'