29 lines
878 B
YAML
29 lines
878 B
YAML
---
|
|
pipeline:
|
|
|
|
build:
|
|
image: python:3.10-bullseye
|
|
commands:
|
|
- pip install -r requirements.txt
|
|
- ./build.py
|
|
|
|
upload:
|
|
image: python:3.10-bullseye
|
|
when:
|
|
branch: main
|
|
secrets:
|
|
- RSYNC_DEST
|
|
- SSH_KNOWN_HOSTS
|
|
- SSH_PRIVATE_KEY
|
|
commands:
|
|
- apt-get update
|
|
- apt-get install --yes --no-install-recommends rsync openssh-client
|
|
- pip3 install -r requirements.txt
|
|
- ./build.py
|
|
- export SSH_PRIVKEY_FILE=.ssh/id_ed25519
|
|
- export SSH_KNOWN_HOSTS_FILE=.ssh/known_hosts
|
|
- mkdir -p .ssh && chmod 0700 .ssh
|
|
- echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVKEY_FILE"
|
|
- echo "$SSH_KNOWN_HOSTS" > "$SSH_KNOWN_HOSTS_FILE"
|
|
- chmod 0600 "$SSH_PRIVKEY_FILE"
|
|
- rsync -v --recursive --delete -e "ssh -oUserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE -i $SSH_PRIVKEY_FILE" "out/" "$RSYNC_DEST"
|