Skip to content

Commit

Permalink
Initialize deploy_production.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Sep 9, 2024
1 parent dd24d35 commit 286c33b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache and install node modules
Expand All @@ -33,7 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache and install node modules
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Deploys to research-catalog-production
name: deploy production

on:
push:
branches:
- production

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: production
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog
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-production --service research-catalog-production --force-new-deployment
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install
Expand Down

0 comments on commit 286c33b

Please sign in to comment.