Bots #1317
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Bots | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
# minute (0 - 59) hour (0 - 23) day of the month (1 - 31) month (1 - 12) day of the week (0 - 6) UTC | |
# Above should be 6:30 AM IST, but for some reason, it is actuall 8:30AM IST. TODO?? | |
# https://github.com/github/feedback/discussions/13454 | |
# The below is for debugging. | |
# - cron: '15 * * * *' | |
# - cron: '30 * * * *' | |
# - cron: '45 * * * *' | |
# - cron: '0 * * * *' | |
workflow_dispatch: | |
inputs: | |
date: | |
required: false | |
description: 'date Eg. 2023-02-01' | |
prev_date: | |
required: false | |
description: 'prev_date Eg. 2023-02-01' | |
jobs: | |
run_bots: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
# python-version: [3.5, 3.6, 3.7, 3.8] | |
steps: | |
- uses: actions/checkout@master | |
with: | |
submodules: 'true' | |
fetch-depth: 1 # Because of this, you will fail to push refs to dest repo | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# python -m pip install git+https://github.com/astropy/astropy@master -U | |
- name: Build package | |
run: | | |
python -m pip install -e . | |
- name: Get current date | |
if: "${{ github.event.inputs.prev_date == '' }}" | |
id: date | |
run: | # No space after + below. | |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Telegram message | |
env: | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
run: | | |
python -m "jyotisha.bot.telegram_bot" --token "$TELEGRAM_BOT_TOKEN" --city "sahakAra nagar, bengaLUru" --channel_id 1001205695765 --md_url_base "https://raw.githubusercontent.com/jyotisham/jyotisha/generated-output/" --html_url_base "https://jyotisham.github.io/jyotisha/output/" --computation_system_str SOLSTICE_POST_DARK_10_ADHIKA__CHITRA_AT_180 --date ${{ steps.date.outputs.prev_date }}${{github.event.inputs.prev_date }} --next_day | |
python -m "jyotisha.bot.telegram_bot" --token "$TELEGRAM_BOT_TOKEN" --city "sahakAra nagar, bengaLUru" --channel_id 1001205695765 --md_url_base "https://raw.githubusercontent.com/jyotisham/jyotisha/generated-output/" --html_url_base "https://jyotisham.github.io/jyotisha/output/" --computation_system_str MULTI_NEW_MOON_SIDEREAL_MONTH_ADHIKA__CHITRA_AT_180 --date ${{ steps.date.outputs.prev_date }}${{github.event.inputs.prev_date }} --next_day | |
- name: Discord message | |
env: | |
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | |
run: | | |
python -m "jyotisha.bot.discord_bot" --token "$DISCORD_BOT_TOKEN" --city "sahakAra nagar, bengaLUru" --channel_id 1019492853132570744 --md_url_base "https://raw.githubusercontent.com/jyotisham/jyotisha/generated-output/" --html_url_base "https://jyotisham.github.io/jyotisha/output/" --computation_system_str SOLSTICE_POST_DARK_10_ADHIKA__CHITRA_AT_180 --date ${{ steps.date.outputs.prev_date }}${{github.event.inputs.prev_date }} --next_day | |
python -m "jyotisha.bot.discord_bot" --token "$DISCORD_BOT_TOKEN" --city "sahakAra nagar, bengaLUru" --channel_id 1019492760513953792 --md_url_base "https://raw.githubusercontent.com/jyotisham/jyotisha/generated-output/" --html_url_base "https://jyotisham.github.io/jyotisha/output/" --computation_system_str MULTI_NEW_MOON_SIDEREAL_MONTH_ADHIKA__CHITRA_AT_180 --date ${{ steps.date.outputs.prev_date }}${{github.event.inputs.prev_date }} --next_day |