We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 032ae32 commit 7ab4e23Copy full SHA for 7ab4e23
.github/workflows/deploy-git-ssh-password.yml
@@ -0,0 +1,26 @@
1
+name: Deploy via SSH by Password
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - main
7
8
+jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
12
+ steps:
13
+ - name: Install sshpass
14
+ run: sudo apt-get update && sudo apt-get install -y sshpass
15
16
+ - name: Deploy to Server via SSH
17
+ env:
18
+ SSHPASS: ${{ secrets.SSH_PASSWORD }}
19
+ run: |
20
+ sshpass -e ssh -p ${{ secrets.SSH_PORT }} -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << EOF
21
+ cd ${{ secrets.PROJECT_DIRECTORY }}
22
+ git fetch origin main
23
+ git reset --hard origin/main
24
+ git clean -fd
25
+ ${{ secrets.RESTART_COMMAND }}
26
+ EOF
0 commit comments