sync-hourly #1104
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: Sync Hourly | |
on: | |
# push: | |
# branches: | |
# - main | |
# schedule: | |
# - cron: '0 * * * *' | |
workflow_dispatch: | |
repository_dispatch: | |
types: [sync-hourly] | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
fetch-depth: 1 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Fetch hot daily api | |
run: | | |
python fetch_hot_daily_api.py | |
python format_tg_markdownv2.py > formatted_text.txt | |
- name: Format to MarkdownV2 | |
run: | | |
{ | |
echo 'FORMATTED_TEXT<<EOF' | |
cat formatted_text.txt | |
echo EOF | |
} >> "$GITHUB_ENV" | |
- name: Post Text | |
uses: xireiki/channel-post@v1 | |
with: | |
bot_token: ${{ secrets.BOT_TOKEN }} | |
chat_id: ${{ secrets.CHAT_ID }} | |
context: ${{ env.FORMATTED_TEXT }} | |
parse_mode: HTML # Optional | |
method: sendMessage |