I have a simple bot that reads certain emails and tweets them. Now I'm trying to automate it and for that I need to run a cron job on the server. Here's my folder structure:
┌ .github
│ └── workflows
│ └── main.yml
├ .env
├ .gitignore
├ app.py
├ post_tweet.py
└ read_email.py
My main file is pretty simple:
#app.py
from read_email import mail_connect
def main():
mail_connect()
if __name__ == '__main__':
main()
The entire project is hosted at Vercel (and integrated with GitHub). I'd like to run this app.py file and from what I've read, I need to create a workflow on GitHub to run it, but I'm having some difficulty (and a little uncertain if it will work).
#main.yml
on:
schedule:
- cron: "*/10 11-13 * * 1-5"
jobs:
build:
runs-on: ubuntu-latest
- uses: actions/checkout@v2 #Do I need this?
- name: Run a one-line script
run: #What could I enter here to run app.py?
While I was writing this question, the following question also came to me: do I really need a server like Vercel to run this or is it possible to do everything just with GitHub?