Skip to content

Commit

Permalink
merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
infinyte-ops committed Jan 30, 2024
2 parents 6950d6f + f1898f7 commit e53e524
Showing 1 changed file with 83 additions and 8 deletions.
91 changes: 83 additions & 8 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Deploy OSS Conductor
name: Build & Publish OSS Conductor

on:
workflow_dispatch:
inputs:
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
Expand All @@ -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 }}

Expand All @@ -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" ]
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -132,20 +139,88 @@ jobs:
uses: docker/[email protected]
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/[email protected]

# - name: Build and push to Amazon ECR
# id: build
# uses: docker/[email protected]
# 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




0 comments on commit e53e524

Please sign in to comment.