The AWSome Books codebase already includes concurrency groups set up for the GitHub Actions workflows. Let’s take a closer look!
With the concurrency group named ${{ github.workflow }}-${{ github.ref }}, this specifies a unique group identifier for the workflow runs. It combines the name of the workflow ${{ github.workflow }} with the Git reference ${{ github.ref }}, which could be a branch or a tag. This means that all runs of a specific workflow for the same branch or tag will be grouped together, preventing them from running concurrently.
To ensure you are always working with the most recent CI checks or dependency updates, it is often beneficial to automatically cancel any ongoing workflows in the same concurrency group. With cancel-in-progress enabled for your CI and Update dependency cache workflows, any previously running instance will be stopped as soon as a new one is triggered, allowing you to focus only on the most recent run.
.github/workflows/ci.yml
|
|
.github/workflows/update-cache.yml
|
|
For Release and Rollback workflows, canceling a running workflow can be risky and potentially disruptive during deployment. Instead, it is often better to leave cancel-in-progress disabled, allowing the most recent workflow to remain pending while another is still running. This ensures that critical processes are not interrupted, providing a smoother and safer deployment experience.
.github/workflows/release.yml
|
|
.github/workflows/rollback.yml
|
|