Skip to content

Merge branch 'qa' into production #1

Merge branch 'qa' into production

Merge branch 'qa' into production #1

# Deploys to nypl-dams-prod.
name: deploy production
on:
push:
branches:
- production
permissions:
id-token: write
contents: read
env:
AWS_DEFAULT_REGION: us-east-1
LOCAL_TAG_NAME: dc-frontend:${{ github.ref_name }}-${{ github.run_number }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::557492996044: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: production
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
ECR_URL: 557492996044.dkr.ecr.us-east-1.amazonaws.com/dc-frontend: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 new-digitalcollections --service new-digitalcollections --force-new-deployment