ericxliu-me/.drone.yml

57 lines
1.3 KiB
YAML
Raw Normal View History

2023-08-27 03:26:41 +00:00
kind: pipeline
name: default
steps:
2023-09-18 02:40:54 +00:00
- name: git-clone
image: alpine/git
2023-09-18 02:44:50 +00:00
environment:
SSH_KEY:
from_secret: ssh_key
2023-09-18 02:40:54 +00:00
volumes:
- name: output
path: /output
commands:
2023-09-18 02:47:16 +00:00
- mkdir -p $HOME/.ssh
2023-09-18 02:44:50 +00:00
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
2023-09-18 03:47:50 +00:00
- chmod 400 $HOME/.ssh/id_rsa
2023-09-18 03:45:15 +00:00
- ssh-keyscan -H git.ericxliu.me > $HOME/.ssh/known_hosts
2023-09-18 02:40:54 +00:00
- git clone --branch gitea-pages git@git.ericxliu.me:eric/ericxliu-me.git /output
2023-09-18 03:59:54 +00:00
- find /output -mindepth 1 -not -regex "^\./\.git.*" -delete
2023-08-27 03:26:41 +00:00
- name: build
image: plugins/hugo
2023-09-18 02:17:59 +00:00
volumes:
2023-09-18 02:34:55 +00:00
- name: output
2023-09-18 02:17:59 +00:00
path: /output
2023-08-27 03:26:41 +00:00
settings:
2023-08-27 03:51:04 +00:00
hugo_version: 0.97.0
extended: true
minify: true
2023-08-27 04:14:46 +00:00
url: ericxliu.me
2023-08-27 03:51:04 +00:00
validate: false
2023-09-18 02:30:40 +00:00
output: "/output"
2023-09-18 01:50:41 +00:00
- name: ls-file
image: alpine/git
2023-09-18 02:17:59 +00:00
volumes:
2023-09-18 02:34:55 +00:00
- name: output
2023-09-18 02:17:59 +00:00
path: /output
2023-09-18 01:50:41 +00:00
commands:
2023-09-18 02:06:51 +00:00
- ls -al /output
2023-08-27 04:14:46 +00:00
- name: git-push
2023-09-11 02:40:22 +00:00
image: appleboy/drone-git-push:0.2.0-linux-amd64
2023-09-18 02:17:59 +00:00
volumes:
2023-09-18 02:34:55 +00:00
- name: output
2023-09-18 02:17:59 +00:00
path: /output
2023-08-27 04:14:46 +00:00
settings:
branch: gitea-pages
2023-09-11 02:37:00 +00:00
remote: "git@git.ericxliu.me:eric/ericxliu-me.git"
2023-08-27 04:14:46 +00:00
force: true
commit: true
2023-09-18 02:34:55 +00:00
path: "/output"
2023-08-27 04:14:46 +00:00
commit_message: "Drone build ${DRONE_COMMIT_SHA:0:7}"
author_name: "Eric Liu"
author_email: "eric@ericxliu.me"
ssh_key:
2023-09-18 02:17:59 +00:00
from_secret: ssh_key
volumes:
- name: output
2023-09-18 02:27:22 +00:00
temp: {}