-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Build and deploy a Docker image to the production AWS environment | ||
# when a new release has been created. | ||
|
||
name: Deploy to Production | ||
|
||
on: | ||
release: | ||
types: | ||
published | ||
|
||
jobs: | ||
deploy-prod: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker image to production | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_PRODUCTION }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_PRODUCTION }} | ||
AWS_ECR_DOCKER_REPO: ${{ secrets.AWS_ECR_DOCKER_REPO_PRODUCTION }} | ||
run: | | ||
echo "production deploy not yet enabled" | ||
# uncomment this when the keys are avaialable! | ||
# ./deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Build and deploy a Docker image to development and staging AWS environments | ||
# when a tagged version is created during weekly dependency updates. | ||
|
||
name: Deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'rel-*-*-*' | ||
|
||
jobs: | ||
deploy-stage-qa: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker image to development (qa in SDR) | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEVELOPMENT }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEVELOPMENT }} | ||
AWS_ECR_DOCKER_REPO: ${{ secrets.AWS_ECR_DOCKER_REPO_DEVELOPMENT }} | ||
run: ./deploy.sh | ||
|
||
- name: Build and push Docker image to staging | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }} | ||
AWS_ECR_DOCKER_REPO: ${{ secrets.AWS_ECR_DOCKER_REPO_STAGING }} | ||
run: ./deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# The following environment variables will need to be set in order to push the | ||
# new speech-to-text Docker image: | ||
# | ||
# - AWS_ACCESS_KEY_ID: the access key for the speech-to-text user | ||
# - AWS_SECRET_ACCESS_KEY: the secret key for the speech-to-text user | ||
# - AWS_ECR_DOCKER_REPO: the Elastic Compute Registry URL for the Docker repository | ||
# | ||
# The values can be obtained by running `terraform output` in the relevant portion of | ||
# the Terraform configuration. | ||
|
||
# Exit immediately if something doesn't work | ||
|
||
set -e | ||
|
||
# Download the Whisper large-v3 model, which is what we use by default. Building | ||
# the image with the model in it already will speed up processing since whisper | ||
# won't need to pull it dynamically. | ||
|
||
wget --timestamping --directory whisper_models https://openaipublic.azureedge.net/main/whisper/models/e5b1a55b89c1367dacf97e3e19bfd829a01529dbfdeefa8caeb59b3f1b81dadb/large-v3.pt | ||
|
||
# Log in to ECR | ||
|
||
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin $AWS_ECR_DOCKER_REPO | ||
|
||
# Build the image for Linux (not really needed when running in Github Actions) | ||
|
||
docker build -t speech-to-text --platform="linux/amd64" . | ||
|
||
# Tag and push the image to ECR | ||
|
||
docker tag speech-to-text $AWS_ECR_DOCKER_REPO | ||
|
||
docker push $AWS_ECR_DOCKER_REPO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
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.