Resources

Beatriz Milz | Making Awesome Automations with GitHub Actions | Posit (2022)

video
Oct 24, 2022
4:35

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

I'm Beatriz, I came all the way from Brazil to talk to you about how to make awesome automations with GitHub Actions.

So anyone here has to run scripts like every day, every week, every month. If you do that, GitHub Actions probably will be useful to you.

So I'm here to talk about what is GitHub Actions and how can we run our scripts with it.

GitHub Actions for package developers

So GitHub Actions has been heavily used by our package developers and for running checks on packages, building the package website and documentation, and if you are a package developer, you can easily do that. Using package, use this, which is my favorite package, and you can also see a lot of other examples in this awesome RLib Actions repository.

So how important is GitHub Actions to RStudio? And Posit. So I look up in the GitHub Action API, no, GitHub API to get the action run, and we can see that in two years, the runs, completed runs for these organizations, which stores our favorite packages, increase it more than four times. So GitHub Actions is really important for RStudio and Posit to run checks on our packages and build the documentation and stuff.

Using GitHub Actions beyond package development

But I told you about what package developers can do, but most people that I know are not package developers. So I'm here to talk about, you guys, how you can use that as well. I've been using it in two years, and in the beginning, it was a bit hard for me, so I'm trying to facilitate this process, right?

So we can run arbitrary R scripts, like scrape data from the internet. I do that a lot, but the government data. When reports with R markdown in Quarto, we can send emails and save results, all doing GitHub Actions with R.

Anatomy of a workflow file

So this is a simple example of a workflow file, but I don't expect you to understand this right now, but the point is, this first part, we have the events, and this part tells when the workflow should run. In this case, we have a button to press, so when we press a button, we start the workflow, and also we have a schedule. So I'm telling the computer that it has to be run every day.

The second part is the name of the workflow, and the third part is what the workflow should do. So this part, the jobs part, imagine that it's a virtual machine that belongs to GitHub, there's nothing installed, and you have to tell what should be installed in order to run R script and what should be done. So I'm telling that I want to run a Ubuntu machine, you can also use Windows machine and Apple machines, macOS machines, and I'm installing R, but this is super easy because of the Rlib action repository, there is a setup there that we just use it, and then I'm saying that I want to run my awesome R script in the end, and remember, that part, you have to install all the packages there, otherwise it won't work, it will break.

you have to install all the packages there, otherwise it won't work, it will break.

So this is a really quick presentation, and I prepared more examples in my blog, and I hope I will continue to do that, so you can see more examples there. I would like to thank especially RStudio for the diversity scholarship, otherwise I couldn't be here, our ladies, the creators and contributors of Rlib actions and articulation, and you can find me on Twitter, and my blog is BeaMills.com. Thank you.