Skip to content

Commit

Permalink
fix github action [8]
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadhabibi14 committed Aug 10, 2023
1 parent 470320c commit 70c15dd
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: Deploy WhatsApp bot

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code 🖥️
- 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_user: ${{ secrets.SERVER_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'

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

- name: Upload with rsync 🔁
run: rsync -avz --exclude=".git" --exclude=".github" ./ 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 }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
Expand Down

0 comments on commit 70c15dd

Please sign in to comment.