Skip to content

fix github-action

fix github-action #2

Workflow file for this run

name: Deploy WhatsApp bot
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
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
# Execute command ke VPS
- name: Execute Command ☣️
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/wabot
go build main.go