From e175c3cfa0d2fb524798d1ac4fcaf64b8ee7ba7f Mon Sep 17 00:00:00 2001 From: Sumit Date: Mon, 12 Jul 2021 16:08:15 +0200 Subject: [PATCH] GitHub action for generating regular updates --- .github/workflows/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1d95db0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + schedule: + - cron: '0 5 * * *' + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.6' + + - uses: BSFishy/pip-action@v1 + with: + requirements: _scripts/crawler/requirements.txt + + - run: python _scripts/crawler/crawler.py --filename _data/hn.json + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + # Optional, but recommended + # Defaults to "Apply automatic changes" + commit_message: Automated Change