From a29261b5c059c2575f33de2789b6459deaa532b9 Mon Sep 17 00:00:00 2001 From: vrifox Date: Wed, 17 May 2023 17:57:02 +0200 Subject: [PATCH] use different directory structure --- .../.hugo-build.yml | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) rename .woodpecker.yml => .woodpecker/.hugo-build.yml (87%) diff --git a/.woodpecker.yml b/.woodpecker/.hugo-build.yml similarity index 87% rename from .woodpecker.yml rename to .woodpecker/.hugo-build.yml index 0a0abc0..a881703 100644 --- a/.woodpecker.yml +++ b/.woodpecker/.hugo-build.yml @@ -4,15 +4,7 @@ pipeline: commands: - hugo --destination /woodpecker/build/ --minify --cleanDestinationDir when: - branch: [ main ] - - build-dev: - image: code.cozy.town/vrifox/hugoci:latest - commands: - - hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" --cleanDestinationDir - when: - branch: - exclude: [ main ] + branch: main upload-stable: image: code.cozy.town/vrifox/hugoci:latest @@ -22,9 +14,22 @@ pipeline: - 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/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc/ --mkpath --checksum - secrets: [ ssh_key, ssh_port, ssh_host ] + secrets: + - ssh_key + - ssh_port + - ssh_host when: - branch: [ main ] + branch: main + + + + build-dev: + image: code.cozy.town/vrifox/hugoci:latest + commands: + - hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" --cleanDestinationDir + when: + branch: + exclude: main upload-dev: image: code.cozy.town/vrifox/hugoci:latest @@ -35,7 +40,10 @@ pipeline: - 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/ caddy@$SSH_HOST:/var/lib/caddy/woodpecker/vrifox.cc-dev/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/ --mkpath --checksum - echo "The preview is now available on https://dev.vrifox.cc/${CI_COMMIT_BRANCH}/${CI_COMMIT_SHA}/" - secrets: [ ssh_key, ssh_port, ssh_host ] + secrets: + - ssh_key + - ssh_port + - ssh_host when: branch: - exclude: [ main ] \ No newline at end of file + exclude: main \ No newline at end of file