Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Refactor HttpStack to streamline domain name initialization and impro… #32

Refactor HttpStack to streamline domain name initialization and impro…

Refactor HttpStack to streamline domain name initialization and impro… #32

Workflow file for this run

name: Beejho Backend
on:
push:
branches:
- main
- stage
- '*' # Matches all other branches (dev branches)
jobs:
deploy_certificate_stack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendCertificateStack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_dynamo_stack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendDynamoStack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_http_stack:
runs-on: ubuntu-latest
needs: [deploy_certificate_stack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendHttpStack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_auth_stack:
runs-on: ubuntu-latest
needs: [deploy_http_stack, deploy_dynamo_stack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendAuthStack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_s3_stack:
runs-on: ubuntu-latest
needs: [deploy_auth_stack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendS3Stack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_restaurant_stack:
runs-on: ubuntu-latest
needs: [deploy_auth_stack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendRestaurantStack -c env=${{ env.ENV_NAME }} --require-approval never
deploy_order_stack:
runs-on: ubuntu-latest
needs: [deploy_auth_stack]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install AWS CDK
run: npm install -g aws-cdk
- name: Install Root Dependencies
run: pnpm install
- name: Install src Dependencies
run: pnpm install
working-directory: src
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Determine Environment Name
run: |
if [[ $GITHUB_REF == refs/heads/main ]]; then
ENV_NAME="prod"
elif [[ $GITHUB_REF == refs/heads/stage ]]; then
ENV_NAME="stg"
else
ENV_NAME="dev"
fi
echo "ENV_NAME=$ENV_NAME" >> $GITHUB_ENV
- name: Deploy CDK
run: cdk deploy BeejhoBackendOrderStack -c env=${{ env.ENV_NAME }} --require-approval never