Skip to content

Merge pull request #250 from NYPL/no_ref/next-upgrade #59

Merge pull request #250 from NYPL/no_ref/next-upgrade

Merge pull request #250 from NYPL/no_ref/next-upgrade #59

Workflow file for this run

# Deploys to nypl-dams-dev.
name: deploy qa
on:
push:
branches:
- qa
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::685731035297: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 }}
API_URL: ${{ secrets.API_URL }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
ECR_URL: 685731035297.dkr.ecr.us-east-1.amazonaws.com/dc-frontend:qa-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 dc-frontend-qa --service dc-frontend-qa --force-new-deployment