Skip to content

Commit 3668cbe

Browse files
authored
Update deploy.yml
1 parent 8e517e4 commit 3668cbe

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,22 @@ jobs:
2222
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
2323
chmod 600 ~/.ssh/id_ed25519
2424
25-
# Define the ProxyCommand variable for reuse
25+
# ProxyCommand using Service Token for Zero Trust bypass
2626
PROXY="cloudflared access ssh --hostname ${{ secrets.SSH_HOST }} --id ${{ secrets.CF_CLIENT_ID }} --secret ${{ secrets.CF_CLIENT_SECRET }}"
2727
28-
# Run rsync
28+
# Sync files to VPS
2929
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 }}
3030
31-
# Run SSH commands
31+
# Build and Restart App
3232
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
35+
# Ensure bin paths are loaded
36+
export PATH=$PATH:/usr/local/bin:/usr/bin
37+
38+
# Build using Nixpacks (Docker will use the WARP proxy we configured)
3639
nixpacks build . --name ${{ github.event.repository.name }}
3740
41+
# Restart or Start the app
3842
pm2 restart ${{ github.event.repository.name }} || pm2 start "nixpacks run ." --name ${{ github.event.repository.name }}
3943
EOF

0 commit comments

Comments
 (0)