diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml index 68fed36b..240f6104 100644 --- a/.github/workflows/deploy-api.yml +++ b/.github/workflows/deploy-api.yml @@ -5,11 +5,10 @@ on: - main jobs: - deploy-alpha: + build: runs-on: ubuntu-latest environment: alpha name: Build and push API docker image for release - if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -40,6 +39,15 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT + setup-database: + name: Setup Database + runs-on: ubuntu-latest + environment: alpha + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js uses: actions/setup-node@v4 with: @@ -56,6 +64,22 @@ jobs: DATABASE_URL: ${{ secrets.DATABASE_URL }} run: pnpm db:deploy-migrations + deploy: + runs-on: ubuntu-latest + environment: alpha + name: Deploy API docker image for release + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.SECRET_KEY }} + aws-region: ap-south-1 + - name: Force re-deploy task in service id: force-redeploy env: diff --git a/.github/workflows/deploy-platform.yml b/.github/workflows/deploy-platform.yml index 86cd96d1..ca97068e 100644 --- a/.github/workflows/deploy-platform.yml +++ b/.github/workflows/deploy-platform.yml @@ -5,11 +5,10 @@ on: - main jobs: - deploy-alpha: + build: runs-on: ubuntu-latest environment: alpha name: Build and push Platform docker image for release - if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -34,12 +33,28 @@ jobs: run: | # Build a docker container and push it to ECR aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin $ECR_REGISTRY - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/platform/Dockerfile . + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} -t $ECR_REGISTRY/$ECR_REPOSITORY:latest -f ./apps/web/Dockerfile . echo "Pushing image to ECR..." docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT + deploy: + runs-on: ubuntu-latest + environment: alpha + name: Deploy Platform docker image for release + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.SECRET_KEY }} + aws-region: ap-south-1 + - name: Force re-deploy task in service id: force-redeploy env: diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 93fca54d..9603e1e4 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -5,11 +5,10 @@ on: - main jobs: - deploy-alpha: + build: runs-on: ubuntu-latest environment: alpha name: Build and push Web docker image for release - if: github.ref == 'refs/heads/main' steps: - name: Checkout @@ -40,6 +39,22 @@ jobs: docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_SHA::6} echo "name=image::$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT + deploy: + runs-on: ubuntu-latest + environment: alpha + name: Deploy Web docker image for release + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ACCESS_KEY }} + aws-secret-access-key: ${{ secrets.SECRET_KEY }} + aws-region: ap-south-1 + - name: Force re-deploy task in service id: force-redeploy env: