Add .gitea/workflows/update-bot.yml
This commit is contained in:
34
.gitea/workflows/update-bot.yml
Normal file
34
.gitea/workflows/update-bot.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Update Bot
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
env:
|
||||||
|
REPO_NAME: focabot
|
||||||
|
jobs:
|
||||||
|
deploy-via-sftp:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: SFTP Deploy
|
||||||
|
uses: https://github.com/wlixcc/SFTP-Deploy-Action@v1.2.4
|
||||||
|
with:
|
||||||
|
username: root
|
||||||
|
server: 172.17.0.1
|
||||||
|
port: 22
|
||||||
|
password: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
local_path: ./*
|
||||||
|
remote_path: /root/${{ env.REPO_NAME }}/
|
||||||
|
ssh_private_key: ignored
|
||||||
|
|
||||||
|
restart-bot:
|
||||||
|
needs: [deploy-via-sftp]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- id: creating-systemctl-service
|
||||||
|
uses: https://github.com/fifsky/ssh-action@master
|
||||||
|
with:
|
||||||
|
command: sudo systemctl start ${{ env.REPO_NAME }}-watcher.service
|
||||||
|
host: 172.17.0.1
|
||||||
|
user: root
|
||||||
|
pass: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
Reference in New Issue
Block a user