File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 77jobs :
88 deploy :
99 runs-on : ubuntu-latest
10+ if : ${{ secrets.VPS_KEY != '' && secrets.VPS_IP != '' && secrets.VPS_USER != '' }}
1011 steps :
1112 - uses : actions/checkout@v4
13+
1214 - name : Set up SSH
1315 run : |
1416 mkdir -p ~/.ssh
1517 echo "${{ secrets.VPS_KEY }}" > ~/.ssh/id_rsa
1618 chmod 600 ~/.ssh/id_rsa
17- ssh-keyscan -H your.vps.ip >> ~/.ssh/known_hosts
19+ ssh-keyscan -H ${{ secrets.VPS_IP }} >> ~/.ssh/known_hosts
1820
1921 - name : Rsync to VPS
20- run : rsync -avz --exclude=".git" ./ youruser@your.vps.ip :/var/www/your-app
22+ run : rsync -avz --exclude=".git" ./ ${{ secrets.VPS_USER }}@${{ secrets.VPS_IP }} :/var/www/your-app
2123
2224 - name : Restart App on VPS
23- run : ssh youruser@your.vps.ip 'cd /var/www/your-app && docker-compose up -d --build'
25+ run : ssh ${{ secrets.VPS_USER }}@${{ secrets.VPS_IP }} 'cd /var/www/your-app && docker-compose up -d --build'
You can’t perform that action at this time.
0 commit comments