telegram-crawler/.github/workflows/make_tracked_links_list.yml

53 lines
1.2 KiB
YAML
Raw Normal View History

2021-04-23 20:39:08 +02:00
name: Generate or update list of tracked links
on:
2022-06-09 14:02:22 +02:00
workflow_dispatch:
2021-04-23 22:02:47 +02:00
schedule:
2022-05-13 12:49:33 +02:00
- cron: '* * * * *'
2021-05-01 15:16:58 +02:00
push:
# trigger on updated link crawler rules
branches:
- main
2021-04-23 20:39:08 +02:00
jobs:
make_tracked_links_file:
name: Make tracked links file
runs-on: macos-10.15
timeout-minutes: 5
2021-04-23 20:39:08 +02:00
steps:
- name: Clone.
uses: actions/checkout@v2
with:
2021-04-25 18:00:32 +02:00
token: ${{ secrets.PAT }}
2021-04-23 20:39:08 +02:00
- name: Setup Python.
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies.
run: |
pip install -r requirements.txt
- name: Generate/update file with links.
2021-04-23 21:47:15 +02:00
env:
OUTPUT_FILENAME: "tracked_links_ci.txt"
2021-06-27 23:06:29 +02:00
COMPARE_OUTPUT_WITH_FILENAME: "tracked_links.txt"
2021-04-23 20:39:08 +02:00
run: |
2021-04-23 21:09:24 +02:00
python make_tracked_links_list.py
2021-04-23 20:39:08 +02:00
- name: Commit and push changes.
run: |
2021-04-23 21:33:11 +02:00
git pull
2021-04-23 21:47:15 +02:00
mv tracked_links_ci.txt tracked_links.txt
2021-04-23 21:19:08 +02:00
2021-04-23 21:09:24 +02:00
git config --global user.email "github-action@users.noreply.github.com"
git config --global user.name "GitHub Action"
2021-04-23 21:01:32 +02:00
2021-04-23 21:49:19 +02:00
git add .
2021-04-23 21:05:55 +02:00
git commit -m "Update tracked links"
2021-04-23 20:39:08 +02:00
git push