From 431f660d3be839091e262893aa3ef16a41a82448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vri=20=F0=9F=8C=88?= Date: Thu, 30 Mar 2023 09:57:53 +0200 Subject: [PATCH] Improve Woodpecker pipeline (#11) Co-authored-by: vrifox Reviewed-on: https://code.cozy.town/vrifox/website/pulls/11 --- .woodpecker.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1726011..04208bf 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,16 +3,32 @@ pipeline: image: archlinux commands: - pacman -Syu --noconfirm hugo git - - hugo --destination /woodpecker/build/vrifox.cc/ --minify --cleanDestinationDir + - hugo --destination /woodpecker/build/ --minify --cleanDestinationDir - upload: + upload-main: image: archlinux commands: - pacman -Syu --noconfirm openssh rsync - mkdir -p /root/.ssh - echo "$SSH_KEY" > /root/.ssh/id_ed25519 + - chmod 700 /root/.ssh/id_ed25519 - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - - rsync -rv -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ woodpecker@$SSH_HOST:/home/woodpecker/build/vrifox.cc/ --checksum + - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ woodpecker@$SSH_HOST:/home/woodpecker/build/vrifox.cc/ --checksum secrets: [ ssh_key, ssh_port, ssh_host ] + when: + branch: main -branches: main + upload-cicd: + image: archlinux + commands: + - pacman -Syu --noconfirm openssh rsync + - mkdir -p /root/.ssh + - echo "$SSH_KEY" > /root/.ssh/id_ed25519 + - chmod 700 /root/.ssh/id_ed25519 + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config + - rsync -rv --delete -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ woodpecker@$SSH_HOST:/home/woodpecker/build/vrifox.cc-cicd/ --checksum + secrets: [ ssh_key, ssh_port, ssh_host ] + when: + branch: cicd + +branches: [ main, cicd ]