Change deploy script
This commit is contained in:
parent
ff076a1876
commit
ef21de2624
1 changed files with 7 additions and 13 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue