1
Fork 0

Change deploy script

This commit is contained in:
Hadeed 2024-10-07 13:25:32 +05:00
parent ff076a1876
commit ef21de2624

View file

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