2022-05-23 22:21:41 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build-and-deploy
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2022-05-23 22:48:21 +00:00
|
|
|
image: klakegg/hugo:alpine
|
2022-05-23 22:21:41 +00:00
|
|
|
volumes:
|
2022-05-23 22:24:50 +00:00
|
|
|
- name: data
|
|
|
|
path: /data
|
2022-05-23 22:21:41 +00:00
|
|
|
commands:
|
2022-05-23 22:48:21 +00:00
|
|
|
- apk add --no-cache git
|
2022-05-23 22:47:40 +00:00
|
|
|
- git submodule init
|
|
|
|
- git submodule update
|
2022-05-26 17:00:18 +00:00
|
|
|
- hugo -d /data/public
|
2022-05-23 22:21:41 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: alpine/git:latest
|
|
|
|
volumes:
|
2022-05-23 22:24:50 +00:00
|
|
|
- name: data
|
|
|
|
path: /data
|
2022-05-23 22:21:41 +00:00
|
|
|
environment:
|
|
|
|
SSH_USER:
|
|
|
|
from_secret: ssh_user
|
|
|
|
SSH_HOST:
|
|
|
|
from_secret: ssh_host
|
|
|
|
SSH_PORT:
|
|
|
|
from_secret: ssh_port
|
|
|
|
SSH_KEY:
|
|
|
|
from_secret: ssh_key
|
|
|
|
commands:
|
2022-05-23 22:44:10 +00:00
|
|
|
- mkdir ~/.ssh
|
|
|
|
- echo "$${SSH_KEY}" > ~/.ssh/id_ed25519
|
|
|
|
- chmod 600 ~/.ssh/id_ed25519
|
2022-05-23 22:41:25 +00:00
|
|
|
- scp -o "StrictHostKeyChecking no" -P $${SSH_PORT} -r /data/public $${SSH_USER}@$${SSH_HOST}:docker/nginx/website
|
2022-05-23 22:53:10 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- pull_request
|
2022-05-23 22:21:41 +00:00
|
|
|
|
|
|
|
volumes:
|
2022-05-23 22:24:50 +00:00
|
|
|
- name: data
|
2022-05-23 22:21:41 +00:00
|
|
|
temp: {}
|