ODNZSL / nzsl-dictionary-scripts

Scripts needed to support the NZSL mobile applications
MIT License
3 stars 2 forks source link

Upload Signbank database to AWS S3 #23

Closed joshmcarthur closed 8 months ago

joshmcarthur commented 8 months ago

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

image

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

image

image

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

image

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 😆