Trying a slightly different workflow

This commit is contained in:
2025-04-10 16:51:35 +01:00
parent f209bbe026
commit 30539739e6
+8 -11
View File
@@ -34,19 +34,16 @@ jobs:
cd server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o executable
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: Deploy to VPS
env:
HOST: hazemkrimi.tech
USER: deploy
KEY: ${{ secrets.DEPLOY_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_vps_deploy
chmod 600 ~/.ssh/id_vps_deploy
echo "Host *" > ~/.ssh/config
echo " StrictHostKeyChecking no" >> ~/.ssh/config
echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config
scp -i ~/.ssh/id_vps_deploy -r client/build $USER@$HOST:/var/www/touch-programming.hazemkrimi.tech/public
scp -i ~/.ssh/id_vps_deploy server/executable $USER@$HOST:/var/www/touch-programming.hazemkrimi.tech/api
ssh-keyscan -H hazemkrimi.tech > ~/.ssh/known_hosts
scp -r client/build $USER@$HOST:/var/www/touch-programming.hazemkrimi.tech/public
scp server/executable $USER@$HOST:/var/www/touch-programming.hazemkrimi.tech/api