File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -22,16 +22,17 @@ jobs:
2222 echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
2323 chmod 600 ~/.ssh/id_ed25519
2424
25- cat <<EOF > ~/.ssh/config
26- Host ${{ secrets.SSH_HOST }}
27- ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h --id ${{ secrets.CF_CLIENT_ID }} --secret ${{ secrets.CF_CLIENT_SECRET }}
28- EOF
25+ # Define the ProxyCommand variable for reuse
26+ PROXY="cloudflared access ssh --hostname ${{ secrets.SSH_HOST }} --id ${{ secrets.CF_CLIENT_ID }} --secret ${{ secrets.CF_CLIENT_SECRET }}"
2927
30- rsync -e "ssh -o StrictHostKeyChecking=no" -avz --delete --exclude '.git' . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/${{ github.event.repository.name }}
28+ # Run rsync
29+ rsync -e "ssh -o StrictHostKeyChecking=no -o ProxyCommand='$PROXY'" -avz --delete --exclude '.git' . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/${{ github.event.repository.name }}
3130
32- ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
31+ # Run SSH commands
32+ ssh -o StrictHostKeyChecking=no -o ProxyCommand="$PROXY" ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
3333 cd /var/www/${{ github.event.repository.name }}
3434
35+ # Use sudo if nixpacks/pm2 requires it
3536 nixpacks build . --name ${{ github.event.repository.name }}
3637
3738 pm2 restart ${{ github.event.repository.name }} || pm2 start "nixpacks run ." --name ${{ github.event.repository.name }}
You can’t perform that action at this time.
0 commit comments