PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

How to update a GitHub Repo daily

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?

Marked As Solved

lpil

lpil

Creator of Gleam

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

Also Liked

PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView
PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

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!

hauleth

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.

Where Next?

Popular in Questions Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement