hay que cambiar esto, importante
This commit is contained in:
@@ -18,15 +18,12 @@ jobs:
|
||||
host: 172.17.0.1
|
||||
user: binlab
|
||||
pass: ${{ secrets.KEY }}
|
||||
args: '-vvv'
|
||||
|
||||
|
||||
deploy-via-sftp:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@latest
|
||||
with:
|
||||
github-server-url: 'http://20.251.208.74:3000'
|
||||
- uses: actions/checkout@v2
|
||||
- id: SFTPDeploy
|
||||
uses: https://github.com/wlixcc/SFTP-Deploy-Action@v1.2.4
|
||||
with:
|
||||
@@ -36,7 +33,7 @@ jobs:
|
||||
# clones entire github repo
|
||||
local_path: ./*
|
||||
# destination of the code on the server
|
||||
remote_path: /home/admin/${{ env.REPO_NAME }}/
|
||||
remote_path: /home/binlab/${{ env.REPO_NAME }}/
|
||||
password: ${{ secrets.KEY }}
|
||||
ssh_private_key: ignored
|
||||
|
||||
@@ -47,7 +44,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 2
|
||||
env:
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
BOT_TOKEN: ${{ secrets.TOKEN }}
|
||||
steps:
|
||||
- id: add-bot-token
|
||||
uses: https://github.com/fifsky/ssh-action@master
|
||||
@@ -59,7 +56,7 @@ jobs:
|
||||
echo $?
|
||||
host: 172.17.0.1
|
||||
user: binlab
|
||||
pass: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
pass: ${{ secrets.KEY }}
|
||||
|
||||
create-systemctl-service:
|
||||
needs: [add-bot-token, deploy-via-sftp]
|
||||
@@ -70,25 +67,26 @@ jobs:
|
||||
with:
|
||||
# Make sure ExecStart=, WorkingDirectory= and chmod +x point to the same directory. These may be unique to your code setup
|
||||
command: |
|
||||
sudo touch /etc/systemd/system/${{ env.REPO_NAME }}.service; chmod /etc/systemd/system/${{ env.REPO_NAME }}.service 666
|
||||
echo "[Unit]
|
||||
Description=${{ env.REPO_NAME }} Discord Bot
|
||||
After=multi-user.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python3 /home/admin/${{ env.REPO_NAME }}/main.py
|
||||
ExecStart=/usr/bin/python3.10 /home/binlab/${{ env.REPO_NAME }}/main.py
|
||||
User=root
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
WorkingDirectory=/home/admin/${{ env.REPO_NAME }}/
|
||||
WorkingDirectory=/home/binlab/${{ env.REPO_NAME }}/
|
||||
[Install]
|
||||
WantedBy=multi-user.target" >> /etc/systemd/system/${{ env.REPO_NAME }}.service
|
||||
chmod +x /root/${{ env.REPO_NAME }}/main.py
|
||||
chmod +x /home/binlab/${{ env.REPO_NAME }}/main.py
|
||||
sudo systemctl enable ${{ env.REPO_NAME }}.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl start ${{ env.REPO_NAME }}.service
|
||||
host: 172.17.0.1
|
||||
user: binlab
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
key: ${{ secrets.KEY }}
|
||||
|
||||
create-systemctl-restart:
|
||||
needs: [create-systemctl-service, add-bot-token, deploy-via-sftp]
|
||||
@@ -98,6 +96,7 @@ jobs:
|
||||
uses: https://github.com/fifsky/ssh-action@master
|
||||
with:
|
||||
command: |
|
||||
sudo touch /etc/systemd/system/${{ env.REPO_NAME }}-watcher.service && chmod 666 /etc/systemd/system/${{ env.REPO_NAME }}-watcher.service
|
||||
echo "[Unit]
|
||||
Description=${{ env.REPO_NAME }} Discord Bot restart
|
||||
After=multi-user.target
|
||||
@@ -111,4 +110,4 @@ jobs:
|
||||
sudo systemctl start ${{ env.REPO_NAME }}-watcher.service
|
||||
host: 172.17.0.1
|
||||
user: binlab
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
key: ${{ secrets.KEY }}
|
||||
|
||||
Reference in New Issue
Block a user