From fe474fac17db930ca3cf21e6a5b210545a7b1b7c Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 19 Nov 2024 10:50:40 -0500 Subject: [PATCH 1/6] Add train deploy workflow --- .github/workflows/deploy_qa.yml | 1 - .github/workflows/deploy_train.yml | 48 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy_train.yml diff --git a/.github/workflows/deploy_qa.yml b/.github/workflows/deploy_qa.yml index 943dbcdd9..f7fc8f457 100644 --- a/.github/workflows/deploy_qa.yml +++ b/.github/workflows/deploy_qa.yml @@ -5,7 +5,6 @@ on: push: branches: - qa - - SCC-4218/move-rc-from-travis-to-github-actions permissions: id-token: write diff --git a/.github/workflows/deploy_train.yml b/.github/workflows/deploy_train.yml new file mode 100644 index 000000000..19d119522 --- /dev/null +++ b/.github/workflows/deploy_train.yml @@ -0,0 +1,48 @@ +# Deploys to research-catalog-train +name: deploy train + +on: + push: + branches: + - train + - set-up-train-env + +permissions: + id-token: write + contents: read + +env: + AWS_DEFAULT_REGION: us-east-1 + LOCAL_TAG_NAME: research-catalog:${{ github.ref_name }}-${{ github.run_number }} + ECR_URL: 946183545209.dkr.ecr.us-east-1.amazonaws.com/research-catalog:train-latest + +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@v2 + + - name: Build and push Docker image to Amazon ECR + run: | + docker build --build-arg NEXT_PUBLIC_APP_ENV=qa --tag $LOCAL_TAG_NAME . + docker tag $LOCAL_TAG_NAME $ECR_URL + # Re-tag last latest image just in case + MANIFEST=$(aws ecr batch-get-image --repository-name research-catalog --image-ids imageTag="train-latest" --output json | jq --raw-output --join-output '.images[0].imageManifest') + aws ecr batch-delete-image --repository-name research-catalog --image-ids imageTag="train-previous" || true + aws ecr put-image --repository-name research-catalog --image-tag "train-previous" --image-manifest "$MANIFEST" || true + docker push $ECR_URL + + - name: Update ECS service + run: | + aws ecs update-service --cluster research-catalog-train --service research-catalog-train --force-new-deployment From e7d825f1182b30b7002d30ad1cbb24e81bcabe77 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 19 Nov 2024 10:51:23 -0500 Subject: [PATCH 2/6] Add console log --- pages/_app.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/_app.tsx b/pages/_app.tsx index f9ae4b707..342a653e9 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -50,6 +50,7 @@ function App({ Component, pageProps }) { // Track page view events to Adobe Analytics useEffect(() => { trackVirtualPageView(router.asPath) + console.log("On train env") }) return ( From a8fb573107e9f500ab2128cc23da302b4f9cdb31 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 19 Nov 2024 11:10:22 -0500 Subject: [PATCH 3/6] Remove console.log --- pages/_app.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 342a653e9..f9ae4b707 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -50,7 +50,6 @@ function App({ Component, pageProps }) { // Track page view events to Adobe Analytics useEffect(() => { trackVirtualPageView(router.asPath) - console.log("On train env") }) return ( From a390c9e397afe94749b1b668b6dd67b89abb4182 Mon Sep 17 00:00:00 2001 From: Diego Cohen Date: Tue, 19 Nov 2024 11:10:51 -0500 Subject: [PATCH 4/6] Add hold-pages to train branches --- .github/workflows/deploy_train.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy_train.yml b/.github/workflows/deploy_train.yml index 19d119522..4af976703 100644 --- a/.github/workflows/deploy_train.yml +++ b/.github/workflows/deploy_train.yml @@ -6,6 +6,7 @@ on: branches: - train - set-up-train-env + - hold-pages permissions: id-token: write From da2b271635f54ceeea2330c08800e75945e4442d Mon Sep 17 00:00:00 2001 From: Vera Kahn Date: Thu, 21 Nov 2024 10:15:46 -0500 Subject: [PATCH 5/6] update eds text --- src/components/EDSBanner.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/EDSBanner.tsx b/src/components/EDSBanner.tsx index 8f41e1efe..c5d04ac66 100644 --- a/src/components/EDSBanner.tsx +++ b/src/components/EDSBanner.tsx @@ -17,10 +17,10 @@ const EDSBanner = () => { New! {" "} - Try our{" "} + Try{" "} - Article Search + Article Plus {" "} to discover online journals, books, and more from home with your From 605dc3de63950aa3cebb2d72726bc6a21e7feac3 Mon Sep 17 00:00:00 2001 From: Vera Kahn Date: Thu, 21 Nov 2024 14:25:27 -0500 Subject: [PATCH 6/6] update link --- src/components/EDSBanner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/EDSBanner.tsx b/src/components/EDSBanner.tsx index c5d04ac66..4fa93166a 100644 --- a/src/components/EDSBanner.tsx +++ b/src/components/EDSBanner.tsx @@ -18,7 +18,7 @@ const EDSBanner = () => { New! {" "} Try{" "} - + Article Plus