create reusable workflows for prod and dev deploy of primary apps #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
To support dev and prod deploys in the primary apps (i.e. service, crawler, website) and to keep code DRY, this PR moves the existing dev and prod workflows for the service repo to operations. The two workflows were merged into one deploy process. Focused steps were split into separate reusable scripts. The split is primarily to accommodate the need for some repositories to deploy to multiple Azure webapps.
Secrets required at various points in the workflows:
Passed Secrets:
Org Secrets:
Workflow basic process
NOTE: See input descriptions in the workflows.
a. get-version
b. uses app-build-docker-image.yml to build the Docker image and publish it to ghcr.io
c. uses app-deploy-to-azure.yml to deploy the primary Azure webapp
d. uses app-deploy-to-azure.yml to deploy the secondary Azure webapp, if passed info on a second Azure webapp
2.a. get-version
-dev_shortsha
(e.g. v1.2.0-dev_1D3F567890)2.b. build-and-push-docker-image
2.c. & d. deploy-to-azure
NOTE: User permissions are checked for both image building and deploy to Azure to ensure the user has permission to modify production. This prevents accidentally allowing a user to deploy to production in the case where the calling workflow fails to verify the user's permissions.
Corresponding app PRs
The following PRs use these workflows:
Related Work
A dev deploy workflow and a prod deploy workflow were originally created separate in the service repo to establish the patterns and process needed to perform each deploy.