From c0bb240e9ad42a97d4a4e5189ac8a85e8cb604aa Mon Sep 17 00:00:00 2001 From: lostinlight Date: Sat, 29 Jan 2022 16:43:26 +0300 Subject: [PATCH] Edit CI config --- .woodpecker.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ed4f5d0..1907096 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,15 +9,28 @@ pipeline: - test -e package.json && npm install - gulp build --cwd ./themes/starter - hexo generate - - find -maxdepth 1 ! -name .git ! -name .domains ! -name public ! -name . -exec rm -rf {} \; - # This only copies non-hidden files; those whose names start with period WOULD NOT be copied - - mv public/* . - - rm -rf public when: branch: include: [ main ] event: [push, deployment] + deploy: + image: alpine + secrets: [ deploy_key ] + commands: + - apk add rsync + - mkdir .ssh + - printf '%s\n' "$${DEPLOY_KEY}" > ~/.ssh/deploy_key + - printf "Host alexandria.debiania.in.ua\n\tIdentityFile ~/.ssh/deploy_key\n\tUserKnownHostsFile=/dev/null\n\tStrictHostKeyChecking=no\n" > ~/.ssh/config + - chmod -R u=rwX,go= ~/.ssh + - rsync -rPvce ssh --chmod=ugo=rwX --no-times public/ www-fediparty@alexandria.debiania.in.ua:www/ + when: + # Only try to deploy if previous step is successful + status: success + branch: + include: [ main ] + event: [push, deployment] + commit: image: alpine secrets: [ ssh_key ] @@ -26,6 +39,10 @@ pipeline: # configure git - git config --global user.email "nonexistent@example.com" - git config --global user.name "Codeberg CI" + - find -maxdepth 1 ! -name .git ! -name .domains ! -name public ! -name . -exec rm -rf {} \; + # This only copies non-hidden files; those whose names start with period WOULD NOT be copied + - mv public/* . + - rm -rf public - git checkout -b pages # deploy changes - git add -A