24 lines
698 B
YAML
24 lines
698 B
YAML
steps:
|
|
build:
|
|
image: python:3
|
|
commands:
|
|
- pip3 install -r requirements.txt
|
|
- mkdocs build --site-dir publish
|
|
|
|
upload:
|
|
image: alpine:latest
|
|
secrets:
|
|
- RSYNC_SSHKEY
|
|
- RSYNC_TARGET_SERVER
|
|
- RSYNC_TARGET_USER
|
|
- RSYNC_TARGET_PATH
|
|
when:
|
|
- event: push
|
|
branch: main
|
|
commands:
|
|
- apk add --update --no-cache openssh rsync git
|
|
- mkdir -p $HOME/.ssh
|
|
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
|
- ssh-keyscan -t ed25519 $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
|
- rsync -avh --delete ./publish/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$RSYNC_TARGET_PATH
|