How to setup github actions to run my python script on schedule?

I have a Github repo which analyzes data of COVID-19 cases from an api which updates everyday.

I have script which clones the data but I don’t know how to setup github actions to run the script daily(automaticaly) so that data gets updated daily.

And one more thing I also want to export my Analysis.ipnb as index.html daily at the same time.

I don’t have any idea how to setup github actions to achive above tasks

Github Repo 

1 Like

Hi @piyushke ,

Thank you for being here! To answer your query:

  1. You need to create a workflow yaml, doc here:

  2. In the yaml, set ‘schedule’ event. Details here. code sample as below:

    name: py
        - cron: "0 0 * * *" #runs at 00:00 UTC everyday
        runs-on: ubuntu-latest
          - name: checkout repo content
            uses: actions/checkout@v2 # checkout the repository content to github runner.
          - name: setup python
            uses: actions/setup-python@v2
              python-version: 3.8 #install the python needed
          - name: execute py script # run the to get the latest data
            run: |
              key: ${{ secrets.key }} # if requires passwords..etc, set it as secrets
          - name: export index
            .... # use crosponding script or actions to help export.


Hi @piyushke,

May I know where is you store the file? Is it under github/workflow folder?

you can write a path ./scripts/ or either put it on the main folder. For example:

run: |