Skip to content

Execute Command on Remote Server #38

Execute Command on Remote Server

Execute Command on Remote Server #38

Workflow file for this run

name: Execute Command on Remote Server
# 定时任务触发,使用 schedule 事件
on:
schedule:
- cron: '0 17 * * *'
jobs:
remote-command:
runs-on: ubuntu-latest
steps:
# 检出代码
- name: Checkout repository
uses: actions/checkout@v3
# 使用 SSH 执行远程命令
- name: Execute command on remote server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script:
bash ~/live/stop.sh && bash ~/live/start.sh