diff --git a/.github/workflows/deploy_production.yml b/.github/workflows/deploy_production.yml index 1106cbcac..354e07f56 100644 --- a/.github/workflows/deploy_production.yml +++ b/.github/workflows/deploy_production.yml @@ -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 diff --git a/.github/workflows/deploy_qa.yml b/.github/workflows/deploy_qa.yml new file mode 100644 index 000000000..fa0ec86aa --- /dev/null +++ b/.github/workflows/deploy_qa.yml @@ -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