GitHub Actions Day 17: Dependent Jobs
December 17, 2019
If you've set up a workflow with multiple jobs -- whether that's a matrix-based workflow or you've just defined the jobs individually -- the jobs run independently of each other, in parallel. Usually, that's ideal. Your jobs will run as soon as machines are available to execute them. But sometimes you want to be able to set up jobs that depend on other jobs. To specify dependencies between jobs, you can use the needs keyword to indicate what jobs rely on the completion of other jobs.
Read more
GitHub Actions Day 16: Conditionals with Shared Data
December 16, 2019
Yesterday we looked at how we can set custom data in one of our workflow steps that we could use in subsequent steps. We did that by adding data to the env context, which is a property bag that you can read and write. But you don't have to limit yourself to using the env context only in your steps. You can also use the env context within your workflow itself, setting up conditionals based on data that you set in earlier steps.
Read more
GitHub Actions Day 15: Sharing Data Between Steps
December 15, 2019
Within a job in GitHub Actions, you can have multiple steps that run one after another. Each step could be invoking an action -- like checking out the code in your repository or installing a particular version of Node.js -- or it could be a run step that simply runs a script that you provide. But often you want to interact with the steps that ran before you -- how do you get that data back and forth?
Read more
GitHub Actions Day 14: Conditionals with a Matrix
December 14, 2019
GitHub Actions has a lot of components that are powerful on their own -- but when you start to use them together, that's when things start to get really powerful. For example: matrix workflows let you easily expand a simple workflow across multiple different jobs. And conditional execution lets you limit the execution of steps within a job. These two features combine pretty naturally -- when you're building a matrix across different operating systems, platforms, or language versions, you might need to run some steps on only a subset of that matrix.
Read more
GitHub Actions Day 13: Conditionals
December 13, 2019
Yesterday we saw that there's a lot of data available to you when you run a workflow. You can use this data within your run steps and use it with your build scripts, deploy steps or repository automation. But you can also use this within the workflow itself. One useful way to take advantage of this data is to use it to run workflow steps conditionally.
Read more
GitHub Actions Day 12: Information about your Workflow
December 12, 2019
Yesterday we saw that GitHub provides some information to GitHub Actions workflow runs -- namely, the GITHUB\_TOKEN. But that's not all; what other information does GitHub Actions provide to you? Actually, quite a lot.
Read more
GitHub Actions Day 11: Secrets
December 11, 2019
Yesterday we set up a workflow that triggered based on paths being changed; it's goal was to publish documentation. If you looked carefully, at the bottom of the workflow, we referenced a variable. It looked sort of like how we referenced matrix variables but instead was referencing a secret. You'll often need things like tokens or passwords in deployment scenarios - GitHub Actions supports savings these as secrets in your repository.
Read more
GitHub Actions Day 10: Path Triggers
December 10, 2019
We saw earlier that we can limit workflow runs based on branch filters. For workflows triggered by a push or a pull\_request, you can limit them so that they only trigger when a particular branch is pushed to, or a pull request is opened against a particular branch. You can also limit these workflows so that they trigger only when a particular path is pushed.
Read more
GitHub Actions Day 9: Deploy to GitHub Packages
December 9, 2019
So far this month, we've looked at a lot of scenarios that perform a build and then run some tests. And these are great workflows -- they ensure that pull requests coming in to your project are high quality and that your master branch is healthy. But you often want to take the next step and deploy something that you build. For example, you might want to build a container and upload it to GitHub Packages every time something new lands in the master branch. This will make sure you have a container that you can run and validate for every change.
Read more
GitHub Actions Day 8: Dealing with Stale Issues
December 8, 2019
Having stale issues hanging around your repository can be a big detriment. Having several-year-old issues that you don't intend to ever fix makes it harder to find the important ones that you want to focus on. Open pull requests that you'll never merge makes it look like you're ignoring the project. And all this cruft in the project adds an invisible cognitive weight. The stale issues workflow can help.
Read more