Skip to content

Commit

Permalink
Initialize deploy_qa.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Sep 9, 2024
1 parent 286c33b commit f096d74
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
env:
APP_ENV: production
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog
ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:production-latest
run: |
docker build --build-arg APP_ENV=$APP_ENV --build-arg NEW_RELIC_LICENSE_KEY=$NEW_RELIC_LICENSE_KEY --tag $LOCAL_TAG_NAME .
docker tag $LOCAL_TAG_NAME $ECR_URL
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Deploys to research-catalog-qa
name: deploy qa

on:
push:
branches:
- qa

permissions:
id-token: write
contents: read

env:
AWS_DEFAULT_REGION: us-east-1
LOCAL_TAG_NAME: research-catalog:${{ github.ref_name }}-${{ github.run_number }}

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::946183545209:role/GithubActionsDeployerRole
aws-region: us-east-1

- name: Log in to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build and push Docker image to Amazon ECR
env:
APP_ENV: qa
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:qa-latest
run: |
docker build --build-arg APP_ENV=$APP_ENV --build-arg NEW_RELIC_LICENSE_KEY=$NEW_RELIC_LICENSE_KEY --tag $LOCAL_TAG_NAME .
docker tag $LOCAL_TAG_NAME $ECR_URL
docker push $ECR_URL
- name: Update ECS service
run: |
aws ecs update-service --cluster research-catalog-qa --service research-catalog-qa --force-new-deployment

0 comments on commit f096d74

Please sign in to comment.