Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github Action deploy #75

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Add Github Action deploy #75

merged 1 commit into from
Jan 30, 2025

Conversation

edsu
Copy link
Contributor

@edsu edsu commented Jan 27, 2025

With this configuration a Github Action will run when a release tag release-YYYY-MM-DD has been created during weekly dependency updates. The action will build the Docker container and deploy it to the development (qa in SDR) and staging AWS environments. This will allow the First Responder for the week to test the latest code using the speech-to-text integration tests.

When the tag has been tested and is ready for production a developer will need to create a release in Github using the release tag. This will cause a build and deploy to the production AWS environment. We may want to think about automated ways for this to happen, but the "serverless" nature of AWS Batch means there really isn't a server for Capistrano (what we use to do other infra deploys) to talk to.

The keys for the different environments need to be set as Github Action Secrets.

  • AWS_ACCESS_KEY_ID_DEVELOPMENT
  • AWS_SECRET_ACCESS_KEY_DEVELOPMENT
  • AWS_ECR_DOCKER_REPO_DEVELOPMENT
  • AWS_ACCESS_KEY_ID_STAGING
  • AWS_SECRET_ACCESS_KEY_STAGING
  • AWS_ECR_DOCKER_REPO_STAGING
  • AWS_ACCESS_KEY_ID_PRODUCTION
  • AWS_SECRET_ACCESS_KEY_PRODUCTION
  • AWS_ECR_DOCKER_REPO_PRODUCTION

Note: only dlss-ops has permission to see the keys for the speech-to-text user in production. So for now the production deploy is a no-op until we actually do need to run in production. Maybe this could be ticketed as follow on work?

I tested using the rel-2025-01-29 release tag, which triggered the deploy Github Action, built and pushed the Docker image to the development and staging AWS environments. I confirmed I could see them in the ECR AWS Console and then watched the speech to text integration test pass.

I also created a Github Release for rel-2025-01-29 which triggered the deploy-prod Github Action which is currently a no-op until we configure the Github repository with the necessary secrets for the speech-to-text user in the production AWS environment.

Closes #46

With this configuration a Github Action will run when a release tag
`release-YYYY-MM-DD` has been created during weekly dependency updates,
The action will build the Docker container and deploy it to the development
(qa in SDR) and staging AWS environments. This will allow the First
Responder for the week to test it using the speech-to-text integration tests.

When the tag has been tested and is ready for production a developer
will need to create a release in Github using the release tag. This will
cause a build and deploy to the production AWS environment. We may want
to think about automated ways for this to happen, but the "serverless"
nature of AWS Batch means there really isn't a server for capistrano
(what we use to do other infra deploys) to talk to.

The keys for the different environments need to be set as
[Github Action Secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).

- AWS_ACCESS_KEY_ID_DEVELOPMENT
- AWS_SECRET_ACCESS_KEY_DEVELOPMENT
- AWS_ECR_DOCKER_REPO_DEVELOPMENT
- AWS_ACCESS_KEY_ID_STAGING
- AWS_SECRET_ACCESS_KEY_STAGING
- AWS_ECR_DOCKER_REPO_STAGING
- AWS_ACCESS_KEY_ID_PRODUCTION
- AWS_SECRET_ACCESS_KEY_PRODUCTION
- AWS_ECR_DOCKER_REPO_PRODUCTION

Note: only dlss-ops has permission to see the keys for the speech-to-text
user in production. So for now this is commented out, until we actually
do need to run in production. Maybe this could be ticketed as follow on
work?

Closes #46
@edsu edsu changed the title Build and deploy image Add Github Action deploy Jan 29, 2025
@edsu edsu marked this pull request as ready for review January 29, 2025 22:50
text_to_speech_access_key_id = "XXXXXXXXXXXXXX"
text_to_speech_secret_access_key = <sensitive>

$ terraform output text_to_speech_secret_access_key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good to know you can do this, definitely more convenient than doing terraform show -json and then text searching the terminal output.

@jmartin-sul jmartin-sul merged commit e23c2c3 into main Jan 30, 2025
1 check passed
@jmartin-sul jmartin-sul deleted the build-image branch January 30, 2025 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build and deploy speech-to-text
2 participants