diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 09825da98..b0b062477 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -1,4 +1,4 @@ -name: Deploy OSS Conductor +name: Build & Publish OSS Conductor on: workflow_dispatch: @@ -6,10 +6,14 @@ on: Environment: required: true type: choice - description: Choose env + description: Choose aws env options: - dev - prd + Tag: + required: true + type: string + description: Provide tag (Eg:v3.14.0) env: SERVICE_NAME: conductor @@ -23,9 +27,11 @@ jobs: outputs: AWS_ROLE: ${{ steps.vars.outputs.AWS_ROLE }} ENV: ${{ steps.vars.outputs.ENV }} + IMAGE_TAG: ${{ steps.vars.outputs.TAG }} PROJECT_PREFIX: ${{ steps.vars.outputs.PROJECT_PREFIX }} ECS_CLUSTER: ${{ steps.set_env.outputs.ECS_CLUSTER }} ECR_REPOSITORY: ${{ steps.set_env.outputs.ECR_REPOSITORY }} + ECR_REPOSITORY_UI: ${{ steps.set_env.outputs.ECR_REPOSITORY_UI }} ENVIRONMENT_BUCKET: ${{ steps.set_env.outputs.ENVIRONMENT_BUCKET }} SLACK_WEBHOOK_URL: ${{ steps.vars.outputs.SLACK_WEBHOOK_URL }} @@ -35,6 +41,7 @@ jobs: run: | BRANCH="${GITHUB_REF#refs/heads/}" ENV=${{ github.event.inputs.environment }} + TAG=${{ github.event.inputs.tag }} echo $BRANCH if [ -z "$ENV" ] @@ -76,10 +83,11 @@ jobs: PROJECT_PREFIX=${{ steps.vars.outputs.PROJECT_PREFIX }} echo "ECS_CLUSTER=$PROJECT_PREFIX-ecs-cluster" >> $GITHUB_OUTPUT echo "ECR_REPOSITORY=$PROJECT_PREFIX-conductor-server" >> $GITHUB_OUTPUT + echo "ECR_REPOSITORY_UI=$PROJECT_PREFIX-conductor-ui" >> $GITHUB_OUTPUT echo "ENVIRONMENT_BUCKET=$PROJECT_PREFIX-s3-environment" >> $GITHUB_OUTPUT echo ":seedling: Branch:${GITHUB_REF#refs/heads/}" >> $GITHUB_STEP_SUMMARY - # Building and Pushing Image to ECR + # Building and Pushing Conductor Server Image to ECR build-push-image: name: Build and Push Image runs-on: 'ubuntu-latest' @@ -122,7 +130,6 @@ jobs: run: | aws s3 cp s3://${PROJECT_PREFIX}-s3-environment/conductor-server/conductor-server.properties .docker/server/config/conductor-server.properties - - name: Amazon ECR Login id: login-ecr uses: aws-actions/amazon-ecr-login@v1.7.0 @@ -132,20 +139,88 @@ jobs: uses: docker/build-push-action@v5.0.0 env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - IMAGE_TAG: ${{ github.sha }} with: context: . file: ./Dockerfile push: true platforms: linux/amd64 tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + - name: image name id: image env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - IMAGE_TAG: ${{ github.sha }} run: | - echo "APP_IMAGE=${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}" >> $GITHUB_OUTPUT - echo "MIGRATE_IMAGE=${{ env.ECR_REGISTRY }}/${{ env.MIGRATE_ECR_REPOSITORY }}:${{ github.sha }}" >> $GITHUB_OUTPUT + echo "APP_IMAGE=${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT + + # # Building and Pushing Conductor UI Image to ECR + # build-push-image-ui: + # name: Build and Push Image + # runs-on: 'ubuntu-latest' + # timeout-minutes: 20 + # permissions: + # id-token: write + # pull-requests: write + # contents: read + # needs: prepare-env + # env: + # AWS_ROLE: ${{ needs.prepare-env.outputs.AWS_ROLE }} + # ENV: ${{ needs.prepare-env.outputs.ENV }} + # PROJECT_PREFIX: ${{needs.prepare-env.outputs.PROJECT_PREFIX}} + # ECR_REPOSITORY: ${{needs.prepare-env.outputs.ECR_REPOSITORY}} + # ENVIRONMENT_BUCKET: ${{needs.prepare-env.outputs.ENVIRONMENT_BUCKET}} + # outputs: + # ECR_REPO: ${{ steps.build.outputs.ECR_REPO }} + # APP_IMAGE: ${{ steps.image.outputs.APP_IMAGE }} + # MIGRATE_IMAGE: ${{ steps.image.outputs.MIGRATE_IMAGE }} + + # steps: + # - name: "Checkout repository" + # uses: actions/checkout@v4 + # - + # # Add support for more platforms with QEMU (optional) + # # https://github.com/docker/setup-qemu-action + # name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # - + # name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Configure AWS credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: ${{ secrets[env.AWS_ROLE] }} + # aws-region: ${{ env.AWS_REGION }} + + # - name: Download S3 file + # run: | + # aws s3 cp s3://${PROJECT_PREFIX}-s3-environment/conductor-server/conductor-server.properties .docker/server/config/conductor-server.properties + + + # - name: Amazon ECR Login + # id: login-ecr + # uses: aws-actions/amazon-ecr-login@v1.7.0 + + # - name: Build and push to Amazon ECR + # id: build + # uses: docker/build-push-action@v5.0.0 + # env: + # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # IMAGE_TAG: ${{ github.sha }} + # with: + # context: . + # file: ./Dockerfile + # push: true + # platforms: linux/amd64 + # tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + # - name: image name + # id: image + # env: + # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + # IMAGE_TAG: ${{ github.sha }} + # run: | + # echo "APP_IMAGE=${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}" >> $GITHUB_OUTPUT + + \ No newline at end of file