From 097ab261128c75e26ae943b6136bd55c9070bcc5 Mon Sep 17 00:00:00 2001 From: vrifox Date: Thu, 30 Mar 2023 09:45:20 +0200 Subject: [PATCH] [CI/CD] add branch cicd condition --- .woodpecker.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 649e56f..074598e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,17 +3,33 @@ pipeline: image: archlinux commands: - pacman -Syu --noconfirm hugo git - - hugo --destination /woodpecker/build/vrifox.cc/ --minify --cleanDestinationDir + - hugo --destination /woodpecker/build/ --minify --cleanDestinationDir - upload: + prepare-upload: 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/ --checksum - secrets: [ ssh_key, ssh_port, ssh_host ] + secrets: [ ssh_key ] + + upload-main: + image: archlinux + commands: + - pacman -Syu --noconfirm openssh rsync + - 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_port, ssh_host ] + when: + branch: main + + upload-cicd: + image: archlinux + commands: + - pacman -Syu --noconfirm openssh rsync + - 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_port, ssh_host ] + when: + branch: cicd branches: [ main, cicd ]