run_workflow #1279
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: run_workflow | |
| on: | |
| schedule: | |
| # Runs everyday at: | |
| # 12:15 AM UTC (GMT0:00) -> 06:00 AM Nepal Time (GMT+5:45) | |
| - cron: "15 00 * * *" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Execute bot script | |
| env: | |
| ALLOTMENT_URL: ${{ secrets.ALLOTMENT_URL }} | |
| BOT_USERNAME: ${{ secrets.BOT_USERNAME }} | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| CHANNEL: ${{ secrets.CHANNEL }} | |
| API_URL: ${{ secrets.API_URL }} | |
| run: | | |
| python run.py | |
| - name: Commit changes if necessary | |
| run: | | |
| git config --global user.email "stonksbot@example.com" | |
| git config --global user.name "stonksbot" | |
| git diff --quiet || (git add nepstonks.db && git commit -m "馃尡 db: add new stocks") | |
| git push origin HEAD:main |