Python News Scraping Scheduled Script #6026
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: Python News Scraping Scheduled Script | |
on: | |
schedule: | |
- cron: "0 6-18 * * 1-5" | |
- cron: "0 */12 * * 0,6" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Timezone | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Rome" | |
- name: Checkout Repository | |
uses: actions/[email protected] | |
- name: Setup Python Version | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install Python Dependencies | |
uses: py-actions/[email protected] | |
with: | |
path: "requirements.txt" | |
- name: Execute Python Script | |
env: | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
CHAT_ID_NEWS_IT: ${{ secrets.CHAT_ID_NEWS_IT }} | |
CHAT_ID_NEWS_EN: ${{ secrets.CHAT_ID_NEWS_EN }} | |
run: python main.py | |
- name: Commit Files | |
run: | | |
git config --local user.name liggiorgio | |
git config --local user.email "[email protected]" | |
git add --all | |
git diff-index --quiet HEAD || git commit -am "GH ACTION News Scraping $(date)" | |
git push origin master | |
env: | |
REPO_KEY: ${{secrets.GITHUB_TOKEN}} | |
username: github-actions |