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: steps:
deploy: deploy:
image: kroniak/ssh-client image: alpine:latest
environment: name: Zip files
- USER=linuxserver.io
- HOST=hadeedahmad.xyz
- PORT=33262
commands: commands:
- mkdir -p ~/.ssh - apk add --no-cache zip curl
- chmod 700 ~/.ssh - zip -r project.zip . -x ".*"
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - 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"
- echo "$SSH_STAGING_KEY" > ~/.ssh/staging.key secrets: [ API_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 ]
when: when:
- event: push - event: push
branch: main branch: main
- event: manual