-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1001 Bytes
/
reload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Reload bot
on:
push:
branches:
- main
workflow_dispatch:
env:
PYTHON: python3.11
PIP: pip3.11
jobs:
reload:
runs-on: [self-hosted, linux]
steps:
- name: Go to the bot directory
run : cd ~/Dijkstra-Chan
- name: Pull and checkout branch
run: |
cd ~/Dijkstra-Chan
git pull origin ${{ github.ref_name }}
git checkout ${{ github.ref_name }}
- name: Set up Python environnement
run: |
cd ~/Dijkstra-Chan
source env/bin/activate
$PYTHON -m pip install --upgrade pip
$PIP install -r requirements.txt
- name: Shutdown bot
continue-on-error: true
run: killall $PYTHON
- name: Run bot
env:
RUNNER_TRACKING_ID: ""
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd ~/Dijkstra-Chan
source env/bin/activate
$PYTHON main.py &