Skip to content

Commit

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

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'bakekok walakakok'

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

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

- name: Upload with rsync 🔁
uses: burnett01/[email protected]
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 }}

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

0 comments on commit ef4a4d2

Please sign in to comment.