diff --git a/.woodpecker.yml b/.woodpecker.yml index a2d10d0..4c084d1 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,4 +1,8 @@ pipeline: + when: + branch: main + event: push + build: image: node:latest commands: @@ -6,11 +10,20 @@ pipeline: - npx @11ty/eleventy --input=. --output=public deploy: - image: node:18 - secrets: - - SWA_CLI_DEPLOYMENT_TOKEN + image: alpine:latest + secrets: + - SSH_KEY + environment: + - TARGET_SERVER=cloud.lauka.net + - TARGET_USER=webadmin + - TARGET_PATH=/webroot/www.lauka.net commands: - - npm install -D @azure/static-web-apps-cli - - npx @azure/static-web-apps-cli deploy ./public --env Production + - apk add --update --no-cache openssh rsync git + - mkdir -p $HOME/.ssh + - echo "$SSH_KEY" > $HOME/.ssh/id_ed25519 + - chmod 0600 $HOME/.ssh/id_ed25519 + - ssh-keyscan -t ed25519 $TARGET_SERVER >> $HOME/.ssh/known_hosts + - cd public/ + - rsync -avh --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH branches: main