From d1966ed5649893610c8fae836b479117f1b00b7e Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Wed, 24 Apr 2024 06:36:32 +0500 Subject: [PATCH] Add woodpecker --- .forgejo/workflows/deploy.yml | 22 ---------------------- .woodpecker.yaml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 .forgejo/workflows/deploy.yml create mode 100644 .woodpecker.yaml diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml deleted file mode 100644 index 5191548..0000000 --- a/.forgejo/workflows/deploy.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: [push] -jobs: - deploy: - runs-on: docker - container: - image: alpine:latest - steps: - - name: Install SSH - run: apk --no-cache add openssh-client - shell: sh - - - name: Configure SSH - run: | - mkdir -p ~/.ssh/ - chmod 700 ~/.ssh/ - echo "${{ secrets.SSH_KEY }}" > ~/.ssh/staging.key - chmod 600 ~/.ssh/staging.key - shell: sh - - - name: Deploy - run: ssh -i ~/.ssh/staging.key -o StrictHostKeyChecking=no hadeed@hadeedahmad.xyz 'cd nginx/www; git fetch; git reset --hard origin/main' - shell: sh diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..7028fba --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,16 @@ +steps: + deploy: + image: kroniak/ssh-client + environment: + - USER=linuxserver.io + - HOST=hadeedahmad.xyz + - PORT=33262 + 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 ]