fix github action [7] #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy WhatsApp bot | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code 🖥️ | |
uses: actions/checkout@v3 | |
- name: Upload with rsync 🔁 | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzr --delete | |
path: ./ | |
remote_path: /root/wabot | |
remote_host: ${{ secrets.SERVER_IP }} | |
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: ${{ secrets.SERVER_USER }} | |
password: ${{ secrets.SERVER_PASS }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: ${{ secrets.SERVER_PORT }} | |
script: | | |
cd /root/wabot | |
go build main.go |