Skip to content

Commit

Permalink
fix github action [3]
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhabibi14 committed Aug 9, 2023
1 parent 9807fa5 commit 25df8f6
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ jobs:
steps:
- name: Checkout Code 🖥️
uses: actions/checkout@v3

- name: Upload with rsync 🔁
uses: burnett01/[email protected]
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
switches: -avzr --delete
path: ./
remote_path: /root/wabot
remote_host: ${{ secrets.SERVER_IP }}
remote_port: ${{ secrets.SSH_PORT }}
remote_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
key: {%- raw -%} ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'bakekok walakakok'

- name: Add known_hosts 🖥️
run: ssh-keyscan -p ${{ secrets.SSH_PORT}} -H ${{ secrets.SERVER_IP }}{% endraw%} >> ~/.ssh/known_hosts

- name: Upload with rsync 🔁
run: rsync -avz "ssh -p ${{ secrets.SSH_PORT }}" ./ root@${{ secrets.SERVER_IP }}:/root/wabot


# Execute command ke VPS
- name: Execute Command ☣️
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_PASS }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SERVER_PORT }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/wabot
go build main.go

0 comments on commit 25df8f6

Please sign in to comment.