oxaliq.net/.woodpecker/build-and-deploy.yml
maren 016b945815
All checks were successful
ci/woodpecker/push/build-and-deploy Pipeline was successful
maren/more-ci-work (#4)
starting to establish a reusable pattern for ssh+deploy.sh from woodpecker for deployments to turtle

after this PR is merged i'll document here: https://wiki.bunk.computer/hypha/ci_-_woodpecker

Reviewed-on: oxaliq/sorrel.dev#4
Co-authored-by: maren <git@stillgreenmoss.net>
Co-committed-by: maren <git@stillgreenmoss.net>
2024-01-08 15:23:08 +00:00

32 lines
826 B
YAML

when:
branch:
include: [ main ]
steps:
build:
image: debian:bookworm-slim
commands:
- apt update
- apt -yq install racket ca-certificates
- yes Y | raco pkg install --no-docs csv-reading
- raco exe sorrel.dev.rkt
- raco distribute dist sorrel.dev
deploy:
image: alpine:latest
secrets:
- deploy_ssh_key
commands:
- echo "SETTING UP SSH"
- apk add openssh-client
- mkdir -p $HOME/.ssh
- ssh-keyscan -t ed25519 turtle.hup.is >> $HOME/.ssh/known_hosts
- echo "$DEPLOY_SSH_KEY" > $HOME/.ssh/id_ed25519
- chmod 0600 $HOME/.ssh/id_ed25519
- echo "SSH SETUP DONE"
- echo "RUNNING DEPLOY SCRIPT"
- ./.woodpecker/deploy.sh
when:
# Only try to deploy if previous step is successful
status: success