Automate PDF compilation with Github Actions #285
Replies: 2 comments 2 replies
-
That's great!! I did add Github Actions to compile the PDF but the nuance was using |
Beta Was this translation helpful? Give feedback.
-
@EduardoFAFernandes Thanks for launching this discussion. We need more posts like this one, with altruist share of knowledge and experience, to build a strong(er) community. 🙏 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone
A couple of days ago I wanted to change something on my thesis and generate the pdf accordingly but did not have my machine with me. I found out that you can use GitHub actions to automatically compile the PDF when a new commit is pushed to the repository. I found this useful and may come in handy for some of you, so here are the instructions on how to do it.
Instructions
.github/workflows/<filename>.yaml
.Results
After pushing this file to the main branch head to your GitHub actions tab and a new workflow should be running.
When the workflow finishes, the main branch should have a new commit with an updated PDF file.
Customization
This script fits my purpose but you may want to change something so here are a couple of important things to guide you.
Change the branch trigger
In this case the main branch is used to trigger the workflow but you may want something else, for example:
Here are some useful links:
Other push trigger options
Other triggers
Notes:
LaTeX Compilation options
To compile the file the action LaTeX compilation is used.
The action is well documented you should be able to find your options there like flags and compiler engine.
Note: I did try to use the make command to compile the project but wasn't successful.
Saving the file
Finally, to save the PDF this file uses the action add-commit
Once again this action is well documented and you should be able to find the options you need in the documentation.
If you don't want to create a new commit there is an other option. You may attach a file to the action result as an artifact with the action upload-artifact. This will be visible in the action's summary page.
Final remarks
I advise against using this option as substitute for a good development environment, local or cloud based. Only as helpful complement. Debugging on GitHub sounds like a nightmare.
Running an action takes resources be considerate and use when there is a need for automatic compilation, you may for example create a dedicated branch dedicated to automatic compilation.
As of writing free users have access to 2000 minutes of processing time a month.
You can check your limits and usage in the Personal Billing page.
The minimum amount of time for 1 run should be at least 2 minutes plus your project compilation time.
To learn more about GitHub actions refer to the original documentation
I wasn't sure if I should add this to the wiki or even where to put it, if you think this is relevant feel free to add it or suggest where I could add it.
Hope this is proves useful.
Cheers.
Beta Was this translation helpful? Give feedback.
All reactions