Update README with Latest Tech News #259
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: Update README with Latest Tech News | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
- cron: "0 12 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Update README | |
env: | |
GNEWS_API_KEY: ${{ secrets.GNEWS_API_KEY }} | |
run: python fetch_news.py | |
- name: Commit | |
run: | | |
git config --global user.name 'tcdtist' | |
git config --global user.email 'chithanh.tist@gmail.com' | |
git commit -am "Automated update" | |
git push | |
env: | |
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} |