Automating tasks with GitHub Actions
In this workshop, attendees will learn about the Actions aspect of GitHub which allows you to write workflows that can spin up processing environments, run commands and special functions called “Actions” and then close those environments automatically. This workshop is the fourth workshop in the GitHub Workshop Series offered by the Brock University Digital Scholarship Lab.
An understanding of using GitHub and basic experience with shell commands is recommended to get the most out of this workshop.
Estimated workshop length: 1.5 hours
Setup
In preparation for this workshop, you will need the following:
- A GitHub account which you can get by clicking the “Sign Up” button at the top right of https://github.com/.
- A GitHub repository to use for the workshop. Even a new repository with just a README.md file will work.
Helpful Materials
GitHub Actions Homepage: GitHubs official page discussing what is possible with GitHub Actions.
GitHub Actions Official Documentation: The official GitHub Actions documentation covering every aspect of what can be done along with descriptions of all of the terminology.
Workshop Tasks
- In your repository, open the “Actions” tab and if you aren’t already on the new workflow page, click the “New workflow” button
- Browse the pre-built workflows to see what is available and then click “Configure” on the workflow called “Simple workflow”
- Explore the workflow editor, making sure to take a quick look at the “Documentation” tab
- Change the name of the workflow
- Change the name of the job from “build” to something different, keeping in mind that the only special characters you can use are dashes and underscores (no spaces!)
- Change one of the steps in the job. This can be as simple as altering the words printed by the “echo” command or as complex as you like!
- Click the “Start commit” button, fill out the commit message, and commit your workflow
- Go to the “Actions” tab and see your workflow in action! Depending on how quick you are it may already be done running, but you can still look at the processes it took
- Once you have done all that, type “WORKFLOW ACTIVATED!!!” in the chat to let me know you are ready to move on
Next Steps
After completing this workshop, the recommended next steps are:
- Try out different workflows to see how they work. The more you use them the easier it will be to implement more complex tasks when you need to!
- Check out the other workshops in our introduction to GitHub Series
This workshop is brought to you by the Brock University Digital Scholarship Lab. For a listing of our upcoming workshops go to Experience BU if you are a Brock affiliate or Eventbrite page for external attendees.