From e96d965ba0a9728f79d79833169199ae219653c3 Mon Sep 17 00:00:00 2001 From: Tony11306 <50052865+tony11306@users.noreply.github.com> Date: Wed, 1 May 2024 13:02:38 +0800 Subject: [PATCH] Create automated_update.yml --- .github/workflows/automated_update.yml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/automated_update.yml diff --git a/.github/workflows/automated_update.yml b/.github/workflows/automated_update.yml new file mode 100644 index 0000000..f6763a2 --- /dev/null +++ b/.github/workflows/automated_update.yml @@ -0,0 +1,32 @@ +name: Scheduled Crawler +on: + schedule: + - cron: "0 0 */3 * *" + +jobs: + run_crawler: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Run crawler script + run: python SchoolSystemModel/crawler_script.py + + - name: Commit and push changes + run: | + git config --global user.email "tony20020507@gmail.com" + git config --global user.name "tony11306" + git add . + git commit -m "Automated update crawler data" + git push origin main