Skip to content

Commit

Permalink
chore: skip review route to scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-schultz committed Jun 28, 2024
1 parent 6869797 commit 0e4ee8f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/actions/deploy_to_aws/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ runs:
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ inputs.aws_region }}
SCROLL_BADGE_SERVICE_IMAGE_TAG: ${{ inputs.docker_tag }}
58 changes: 27 additions & 31 deletions .github/workflows/release_and_deploy_generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
description: "Create a github release for this deployment"
type: boolean
required: false
deploy_review:
description: "Deploy to review"
type: boolean
required: false
# deploy_review:
# description: "Deploy to review"
# type: boolean
# required: false
deploy_staging:
description: "Deploy to staging"
type: boolean
Expand All @@ -24,17 +24,13 @@ on:
description: "Deploy to production"
type: boolean
required: false
# deploy_production_upon_approval:
# description: "Deploy to production"
# type: boolean
# required: false
secrets:
PULUMI_ACCESS_TOKEN:
required: true
AWS_ACCESS_KEY_ID_REVIEW:
required: true
AWS_SECRET_ACCESS_KEY_REVIEW:
required: true
# AWS_ACCESS_KEY_ID_REVIEW:
# required: false
# AWS_SECRET_ACCESS_KEY_REVIEW:
# required: false
AWS_ACCESS_KEY_ID_STAGING:
required: false
AWS_SECRET_ACCESS_KEY_STAGING:
Expand Down Expand Up @@ -118,15 +114,15 @@ jobs:
ecr_repository_name: scroll-badge-service
dockerfile_name: Dockerfile
build_dir: ./
- name: Docker Push to Review
uses: ./.github/actions/docker_deploy
if: ${{ inputs.deploy_review }}
with:
docker_tag: ${{ steps.sha.outputs.sha_short }}
ecr_repository_name: scroll-badge-service
aws_region: us-west-2
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_REVIEW }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_REVIEW }}
# - name: Docker Push to Review
# uses: ./.github/actions/docker_deploy
# if: ${{ inputs.deploy_review }}
# with:
# docker_tag: ${{ steps.sha.outputs.sha_short }}
# ecr_repository_name: scroll-badge-service
# aws_region: us-west-2
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_REVIEW }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_REVIEW }}
- name: Docker Push to Staging
uses: ./.github/actions/docker_deploy
if: ${{ inputs.deploy_staging }}
Expand Down Expand Up @@ -161,16 +157,16 @@ jobs:
fetch-depth: 0
- name: Prepare to Deploy to AWS
uses: ./.github/actions/prepare_deploy_to_aws
- name: Deploy Review
uses: ./.github/actions/deploy_to_aws
if: ${{ inputs.deploy_review }}
with:
docker_tag: ${{ needs.docker.outputs.docker_tag }}
stack_name: gitcoin/review
aws_region: us-west-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_REVIEW }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_REVIEW }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
# - name: Deploy Review
# uses: ./.github/actions/deploy_to_aws
# if: ${{ inputs.deploy_review }}
# with:
# docker_tag: ${{ needs.docker.outputs.docker_tag }}
# stack_name: gitcoin/review
# aws_region: us-west-2
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_REVIEW }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_REVIEW }}
# PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: Deploy Staging
uses: ./.github/actions/deploy_to_aws
if: ${{ inputs.deploy_staging }}
Expand Down
18 changes: 12 additions & 6 deletions infra/aws/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const PASSPORT_VC_SECRETS_ARN = `${process.env["PASSPORT_VC_SECRETS_ARN"]}`;

const route53Domain = `${process.env["ROUTE_53_DOMAIN"]}`;
const route53Zone = `${process.env["ROUTE_53_ZONE"]}`;
const dockerGtcPassportIamImage = `${process.env["DOCKER_GTC_PASSPORT_IAM_IMAGE"]}`;

export const dockerScrollServiceImage = `${process.env.SCROLL_BADGE_SERVICE_IMAGE_TAG || ""}`;

const stack = pulumi.getStack();
const region = aws.getRegion({});
Expand Down Expand Up @@ -122,6 +123,7 @@ const albTargetGroup = new aws.lb.TargetGroup(`scroll-badge-service`, {

const albListenerRule = new aws.lb.ListenerRule(`scroll-badge-service-https`, {
listenerArn: albHttpsListenerArn,
priority: 1,
actions: [
{
type: "forward",
Expand All @@ -133,7 +135,11 @@ const albListenerRule = new aws.lb.ListenerRule(`scroll-badge-service-https`, {
hostHeader: {
values: [route53Domain],
},
// pathPattern: {[]}
},
{
pathPattern: {
values: ["/scroll*"],
},
},
],
tags: {
Expand All @@ -145,12 +151,12 @@ const albListenerRule = new aws.lb.ListenerRule(`scroll-badge-service-https`, {
//////////////////////////////////////////////////////////////
// ECS Task & Service
//////////////////////////////////////////////////////////////
const taskDefinition = new aws.ecs.TaskDefinition(`passport-iam`, {
family: `passport-iam`,
const taskDefinition = new aws.ecs.TaskDefinition(`scroll-badge-service`, {
family: `scroll-badge-service`,
containerDefinitions: JSON.stringify([
{
name: "iam",
image: dockerGtcPassportIamImage,
name: "scroll-badge-service",
image: dockerScrollServiceImage,
cpu: 512,
memory: 1024,
links: [],
Expand Down

0 comments on commit 0e4ee8f

Please sign in to comment.