diff --git a/.github/workflows/mfe-common-ui-docker.yml b/.github/workflows/mfe-common-ui-docker.yml index 582dd1805f5..8266aee50df 100644 --- a/.github/workflows/mfe-common-ui-docker.yml +++ b/.github/workflows/mfe-common-ui-docker.yml @@ -28,7 +28,7 @@ jobs: id: docker_build working-directory: ./micro-ui/web/packages/common run: | - IMAGE_TAG=egovio/core-digit-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} + IMAGE_TAG=egovio/common-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} docker build . \ --file docker/Dockerfile \ --tag $IMAGE_TAG @@ -46,4 +46,4 @@ jobs: # Push the image to Docker Hub docker push $IMAGE_NAME - echo "Docker image pushed: $IMAGE_NAME" \ No newline at end of file + echo "Docker image pushed: $IMAGE_NAME" diff --git a/.github/workflows/mfe-dss-ui-docker.yml b/.github/workflows/mfe-dss-ui-docker.yml index d164bed9b0f..144b7603c7e 100644 --- a/.github/workflows/mfe-dss-ui-docker.yml +++ b/.github/workflows/mfe-dss-ui-docker.yml @@ -14,19 +14,36 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for tags and branches + + - name: Set up environment variables + id: env + run: | + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + echo "COMMIT_ID=${GITHUB_SHA: -8}" >> $GITHUB_ENV # Extract last 8 characters of SHA + - name: Build the Docker image + id: docker_build working-directory: ./micro-ui/web/packages/dss - run: docker build . --file docker/Dockerfile --tag egovio/dss-ui:latest + run: | + IMAGE_TAG=egovio/dss-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} + docker build . \ + --file docker/Dockerfile \ + --tag $IMAGE_TAG + echo "::set-output name=image_name::$IMAGE_TAG" - name: Login to Docker Hub and Push Docker Image working-directory: ./micro-ui/web/packages/dss env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: ${{ steps.docker_build.outputs.image_name }} run: | # Authenticate with Docker Hub echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # Push the image to Docker Hub - docker push egovio/dss-ui:latest - + docker push $IMAGE_NAME + echo "Docker image pushed: $IMAGE_NAME" diff --git a/.github/workflows/mfe-hrms-ui-docker.yml b/.github/workflows/mfe-hrms-ui-docker.yml index 121bf92cbbf..e88e1a9db84 100644 --- a/.github/workflows/mfe-hrms-ui-docker.yml +++ b/.github/workflows/mfe-hrms-ui-docker.yml @@ -14,19 +14,36 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for tags and branches + + - name: Set up environment variables + id: env + run: | + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + echo "COMMIT_ID=${GITHUB_SHA: -8}" >> $GITHUB_ENV # Extract last 8 characters of SHA + - name: Build the Docker image + id: docker_build working-directory: ./micro-ui/web/packages/hrms - run: docker build . --file docker/Dockerfile --tag egovio/hrms-ui:latest + run: | + IMAGE_TAG=egovio/hrms-ui:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} + docker build . \ + --file docker/Dockerfile \ + --tag $IMAGE_TAG + echo "::set-output name=image_name::$IMAGE_TAG" - name: Login to Docker Hub and Push Docker Image working-directory: ./micro-ui/web/packages/hrms env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: ${{ steps.docker_build.outputs.image_name }} run: | # Authenticate with Docker Hub echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # Push the image to Docker Hub - docker push egovio/hrms-ui:latest - + docker push $IMAGE_NAME + echo "Docker image pushed: $IMAGE_NAME" diff --git a/.github/workflows/mfe-workbench-web-docker.yml b/.github/workflows/mfe-workbench-web-docker.yml index 8fbdc63f044..3a4f12d9d85 100644 --- a/.github/workflows/mfe-workbench-web-docker.yml +++ b/.github/workflows/mfe-workbench-web-docker.yml @@ -14,19 +14,36 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for tags and branches + + - name: Set up environment variables + id: env + run: | + echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "ACTION_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV + echo "COMMIT_ID=${GITHUB_SHA: -8}" >> $GITHUB_ENV # Extract last 8 characters of SHA + - name: Build the Docker image + id: docker_build working-directory: ./micro-ui/web/packages/workbench - run: docker build . --file docker/Dockerfile --tag egovio/workbench-web:latest + run: | + IMAGE_TAG=egovio/workbench-web:${{ env.BRANCH_NAME }}-${{ env.COMMIT_ID }}-${{ env.ACTION_NUMBER }} + docker build . \ + --file docker/Dockerfile \ + --tag $IMAGE_TAG + echo "::set-output name=image_name::$IMAGE_TAG" - name: Login to Docker Hub and Push Docker Image working-directory: ./micro-ui/web/packages/workbench env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: ${{ steps.docker_build.outputs.image_name }} run: | # Authenticate with Docker Hub echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # Push the image to Docker Hub - docker push egovio/workbench-web:latest - + docker push $IMAGE_NAME + echo "Docker image pushed: $IMAGE_NAME"