Conditional actions in GitHub Workflows

When modeling complex tasks in a workflow, you sometimes might want not to execute a specific step – depending on the context. Let’s have a (simplified) example.

Using a build matrix, we build a debug and release version of the app.

This workflow will be executed twice; each run will have a unique value stored in the build_type context variable. First one “development” and the second one “release.”

We want however only the “release” build to be uploaded to the AppStore.

This step will be executed only when the defined condition is met.

Complete workflow:

We make use of these features in our Tabris.js Hello World app nightly builds. Take a look at the repository and see how our workflows look like.

Check out other posts about using deploy keys on Github Actions and how do we manage Apple certificates and provisioning profiles if you haven’t done it yet. With that knowledge, you will be able to quickly set up an iOS build job of your app on Github.

Let us know about your thoughts and if you’re interested in more build-related topics.