Skip to content

chore(ci): Add internal package dependencies to existing workflows (#… #21

chore(ci): Add internal package dependencies to existing workflows (#…

chore(ci): Add internal package dependencies to existing workflows (#… #21

name: Deploy Platform
on:
workflow_dispatch:
push:
branches:
- main
- develop
paths:
[
'apps/platform/**',
'.github/workflows/deploy-platform.yml',
'package.json'
]
jobs:
build:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'beta' || 'stage' }}
name: Build and push Platform docker image for release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker Login
uses: azure/docker-login@v2
with:
login-server: ${{ vars.ACR_REGISTRY_URL }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build Docker image
id: build
env:
ACR_REGISTRY_URL: ${{ vars.ACR_REGISTRY_URL }}
REPOSITORY_NAME: platform
run: |
# Build a docker container and push it to ACR
docker build -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6} -t $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest -f ./apps/platform/Dockerfile .
echo "Pushing image to ACR..."
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:latest
docker push $ACR_REGISTRY_URL/$REPOSITORY_NAME:${GITHUB_SHA::6}
echo "name=image::$ACR_REGISTRY_URL/$REPOSITORY_NAME:latest" >> $GITHUB_OUTPUT
# deploy:
# needs: build
# 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:
# ECS_CLUSTER: ${{ vars.ECS_CLUSTER }}
# ECS_SERVICE: ${{ vars.ECS_PLATFORM_SERVICE }}
# run: |
# aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment