PJUllrich
I have a GitHub project in which I store data collected by bicycle counting stations scattered around Cologne, Germany. At the moment, I update the data manually by running a Python script, which fetches the data and appends it to CSV-files. I then add and push the changes using git to the GitHub Project.
I would like to automate this process using an existing Elixir + Phoenix application I have running on Heroku. Since that app doesn’t do much, I thought that I could add a reoccurring job, maybe using Oban, which would fetch and push the data on a daily basis. The problem that I am facing now is how to implement this “in a smart way”.
My current plan is to clone the git repository to my Heroku machine and perform the git actions using e.g. elixir-git-cli. However, this feels a bit clunky and I was wondering whether you have an idea or experiences with automating reoccurring jobs which use git commands? Is there maybe a way to push changes to GitHub without having to clone a git repository first?
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hauleth
You can create commit via GitHub API directly.
lpil
Perhaps I’m misunderstanding the docs, but you would still need a git client to push the git object to GitHub’s remote to use that API, it doesn’t seem to offer a way to send a patch with your API request?
lpil
Rather than using the Elixir application could you run the code on GitHub actions? It supports periodic jobs. https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
hauleth
You can create blob and tree. This will require some manual labour to properly define such commit, but you do not need Git client at all.
PJUllrich
Oh, that’s a great idea since I then don’t even have to re-purpose my other application in order to run this script! I’ll check it out, thank you
PJUllrich
Hmm, that sound’s like a possible, but complex solution. I’ll check whether I can use GitHub Actions first, but if not, then I’ll have a closer look to this solution. So, thank you
lpil
Thank you for the explanation:)
PJUllrich
I ended up using this GitHub Action to commit and push any changes made to the repo while running the GitHub Action. The full workflow can be found on GitHub. Thanks for the solution @lpil!
PJUllrich
I wrote up my experiences in a short Medium post
https://medium.com/@peter.j.ullrich/how-to-set-up-reoccurring-jobs-with-github-actions-ce522358326b