setting up GitHub actions
automate your literature recommendation automation tool
Okay, hopefully you're interested in using refy by now, but you don't really want to have to manually run it in python once or twice a week. If the point of refy is to automate papers recommendation, automate refy too!
I assume that you're fairly familiar with GitHub here and know how to create and edit GitHub repositories. If not, please get in touch and I'll try to help with more details.
The easiest way is to use GitHub Actions to have refy update a GitHub repository for you. If you're repository's published to a GitHub Pages website, refy can even update your website for you! If everything works correctly, you'll have a GH action running periodically and updating your repository with the latest freshest preprints.
Currently the best way I've found to do this is is to let the GH action update my website. Maybe someone has a way to have actions email content to users instead, that'd be great. Get in touch if you know how to improve this workflow!
These are the steps to setup refy on GH Actions:
In your GH repository, save a
library.bib
file with your papers metadata and create a folder calledscripts
In your
scripts
folder, createrun_refy.py
The content ofrun_refy.py
should be:
when your GH action runs, it will execute run_refy.py
and this will create a refy.html
file with your recommendations.
3. Create a new GitHub Actions workflow. From your repository's page, select Actions
from there, on the top left click onNew Workflow
and in the next page select Simple Workflow
(click on 'setup this workflow'). This will take you to a new page where you can edit your action's yaml
workflow file. Delete all precompiled content and replace it with:
Make sure to replace YOURUSERNAME
at row 35
with your GitHub username.
You can read more about the workflow file syntax on the documentation, but this is the essence of what's happening.
this bit specifies when your GitHub action should run. Currently it runs on push, i.e. when you push a commit to your repository and on schedule. GH actions allows you to use cron syntax to schedule jobs that should run periodically. You can use this to have your action run as frequently as you'd like, I have it such that it updates my website three times a week.
Next, this:
setups a python environment on the action's virtual machine and it fetches the latest refy code from its GH repository.
Then, the python script we created above is ran by:
as we saw, this updates a refy.html
file in your repository, so the next step is to commit this new version to your repository:
Last updated