I've adjusted the dictionary export workflow so that an environment must be specified - either Prerelease or Production. Based on the input environment, the workflow exports either a prerelease or production database, uploads it to S3, and if it's a production build, outputs the resulting database as a build artifact on the actions run.
An example of a prerelease run, with the file uploaded to S3:
A neat thing about environments is that they can have branch protection rules attached to them. This prevents workflows that use that environment from running unless it meets the protection rules. As an example, I've activated a branch protection rule that only allows the workflow to be run against the 'main' branch, as shown in this build:
This pull request pairs with https://github.com/ODNZSL/nzsl-infrastructure/pull/3 to automatically publish prerelease or production Signbank databases to the appropriate S3 bucket (UAT or Production).
I've adjusted the dictionary export workflow so that an environment must be specified - either Prerelease or Production. Based on the input environment, the workflow exports either a prerelease or production database, uploads it to S3, and if it's a production build, outputs the resulting database as a build artifact on the actions run.
An example of a prerelease run, with the file uploaded to S3:
https://github.com/ODNZSL/nzsl-dictionary-scripts/actions/runs/7201324009
An example of a production run, with the attached artifcacts and file uploaded to S3:
https://github.com/ODNZSL/nzsl-dictionary-scripts/actions/runs/7201414593
A neat thing about environments is that they can have branch protection rules attached to them. This prevents workflows that use that environment from running unless it meets the protection rules. As an example, I've activated a branch protection rule that only allows the workflow to be run against the 'main' branch, as shown in this build:
https://github.com/ODNZSL/nzsl-dictionary-scripts/actions/runs/7201433151
Once this PR is merged, I'd recommend we put the same rule in place for the prerelease export.
Note: I will of course squash merge, this was more iterative than I had planned 😆