Run bot #1340
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: Run bot | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 */6 * * *' | |
workflow_dispatch: {} # Add workflow dispatch for manual triggering | |
jobs: | |
run-bot: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Pass Environment Variables and Run Scripts | |
env: | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
COG_SERVICE_KEY: ${{ secrets.COG_SERVICE_KEY }} | |
COG_SERVICE_REGION: ${{ secrets.COG_SERVICE_REGION }} | |
SUBSCRIPTION_KEY: ${{ secrets.SUBSCRIPTION_KEY }} | |
run: | | |
# Pass the secrests as environment variables to script | |
python bot.py | |
# - name: Check for changes | |
# id: check_changes | |
# run: | | |
# git diff --exit-code || echo "::set-output name=changes::true" | |
# - name: Commit and Push Changes | |
# if: steps.check_changes.outputs.changes == 'true' | |
# run: | | |
# git pull | |
# git add . | |
# git commit -m "Updated leaderboard and resized images for Project 1." | |
# git remote set-url origin https://[email protected]/mlsanigeria/AI-Hacktober-MLSA.git | |
# git push |