From ef21de2624636689ef138ce494262cb725abf28f Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Mon, 7 Oct 2024 13:25:32 +0500 Subject: [PATCH] Change deploy script --- .woodpecker.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 2193abe..ad06159 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -1,19 +1,13 @@ steps: deploy: - image: kroniak/ssh-client - environment: - - USER=linuxserver.io - - HOST=hadeedahmad.xyz - - PORT=33262 + image: alpine:latest + name: Zip files commands: - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - - echo "$SSH_STAGING_KEY" > ~/.ssh/staging.key - - chmod 600 ~/.ssh/staging.key - - ssh -i ~/.ssh/staging.key -p $${PORT} $${USER}@$${HOST} "rm -rf /srv/hadeedahmad-xyz" - - scp -ri ~/.ssh/staging.key -P $${PORT} * $${USER}@$${HOST}:/srv/hadeedahmad-xyz - secrets: [ SSH_STAGING_KEY ] + - apk add --no-cache zip curl + - zip -r project.zip . -x ".*" + - curl -s -w "{%http_code}" -X POST -F "zipfile=@project.zip" -H "Authorization: Bearer $API_KEY" https://pages.hadeedahmad.com/pages/me | grep -q "200" + secrets: [ API_KEY ] when: - event: push branch: main + - event: manual