Skip to content

Merge pull request #210 from NYPL/release/0.1.15 #5

Merge pull request #210 from NYPL/release/0.1.15

Merge pull request #210 from NYPL/release/0.1.15 #5

# 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 }}
API_URL: ${{ secrets.API_URL }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
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 --build-arg API_URL=$API_URL --build-arg AUTH_TOKEN=$AUTH_TOKEN --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