Deploy Discord Bot #973
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Discord Bot | |
| on: | |
| push: | |
| branches: main | |
| schedule: | |
| # Chạy từ 0h đến 6h (00:00 - 06:00) | |
| - cron: '0 0 * * *' # Lúc 0h | |
| - cron: '0 3 * * *' # Lúc 3h | |
| # Chạy từ 6h đến 12h (06:00 - 12:00) | |
| - cron: '0 6 * * *' # Lúc 6h | |
| - cron: '0 9 * * *' # Lúc 9h | |
| # Chạy từ 12h đến 18h (12:00 - 18:00) | |
| - cron: '0 12 * * *' # Lúc 12h | |
| - cron: '0 15 * * *' # Lúc 15h | |
| # Chạy từ 18h đến 24h (18:00 - 24:00) | |
| - cron: '0 18 * * *' # Lúc 18h | |
| - cron: '0 21 * * *' # Lúc 21h | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 # Set a 6-hour timeout for each job (6h x 60m) | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: false # Avoid canceling in-progress jobs | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Deploy bot | |
| run: | | |
| python ai.py & | |
| python noitu.py & | |
| python wall.py & | |
| python haiten.py & | |
| python night.py | |
| sleep 21600 # Giữ bot hoạt động trong 3600 giây (1 giờ) | |
| env: | |
| DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} | |
| NOITU_TOKEN: ${{ secrets.NOITU_TOKEN }} | |
| WALL_TOKEN: ${{ secrets.WALL_TOKEN }} | |
| UNIXPORN_TOKEN: ${{ secrets.UNIXPORN_TOKEN }} | |
| NT_TOKEN: ${{ secrets.NT_TOKEN }} |