1
Fork 0

Add woodpecker

This commit is contained in:
Hadeed 2024-04-24 06:36:32 +05:00
parent ab5f8909af
commit d1966ed564
2 changed files with 16 additions and 22 deletions

View file

@ -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

16
.woodpecker.yaml Normal file
View file

@ -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 ]