Skip to content

Commit

Permalink
feat: add lichess.yml and vps-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MattEstHaut committed Apr 12, 2024
1 parent e8b4c0f commit 7c4ebab
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/lichess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Restart lichess-bot service

run-name: Restart lichess-bot by @${{ github.actor }}

on:
workflow_run:
workflows: ["Deploy to VPS on push"]
types:
- completed
branches:
- master

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Restart lichess-bot service
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script_stop: true
script: |
echo ${{secrets.PASSWORD}} | sudo -S systemctl restart lichess-bot.service
26 changes: 26 additions & 0 deletions .github/workflows/vps-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to VPS on push

run-name: Deploy to VPS by @${{ github.actor }}

on:
push:
branches:
- master

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Pull and build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script_stop: true
script: |
cd /home/${{ secrets.USERNAME }}/Victoire
git pull origin master
zig build -Doptimize=ReleaseFast

0 comments on commit 7c4ebab

Please sign in to comment.