2022-05-23 22:21:41 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build-and-deploy
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2022-11-20 18:38:45 +00:00
|
|
|
image: klakegg/hugo:ext-alpine
|
2022-07-05 12:51:22 +00:00
|
|
|
environment:
|
|
|
|
HUGO_SECURITY_HTTP_URLS: none
|
2022-05-23 22:21:41 +00:00
|
|
|
commands:
|
2022-11-20 18:40:15 +00:00
|
|
|
- apk add --no-cache git py3-pygments
|
2022-06-14 12:33:51 +00:00
|
|
|
- git submodule update --init --single-branch --depth=1
|
2022-07-05 12:51:22 +00:00
|
|
|
- hugo
|
2022-05-23 22:21:41 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: alpine/git:latest
|
|
|
|
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-11-20 16:58:41 +00:00
|
|
|
- ssh -o "StrictHostKeyChecking no" -p $${SSH_PORT}
|
2022-11-20 17:01:54 +00:00
|
|
|
$${SSH_USER}@$${SSH_HOST} "rm -rf docker/nginx/website/public/*"
|
2022-10-15 13:22:52 +00:00
|
|
|
- scp -o "StrictHostKeyChecking no" -P $${SSH_PORT} -r
|
2022-10-15 13:22:05 +00:00
|
|
|
./public $${SSH_USER}@$${SSH_HOST}:docker/nginx/website
|
2022-05-23 22:53:10 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- pull_request
|