Deploy Discord Bot #220
This file contains 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: | |
schedule: | |
# Запускать каждые 7 часов | |
- cron: '1 */7 * * *' | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Load Environment Variables | |
run: | | |
echo "DISCORD_KEY=${{ secrets.DISCORD_KEY }}" >> $GITHUB_ENV | |
echo "GITHUB=${{ secrets.GITHUB }}" >> $GITHUB_ENV | |
- name: Run bot | |
env: | |
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} | |
run: | | |
python main.py |