@@ -2,15 +2,14 @@ name: BuildEngine v2 Test and Deploy
22
33on :
44 push :
5+ branches :
6+ - master
7+ - develop
58 workflow_dispatch :
69 inputs :
710 tags :
811 description : " Tags"
912
10- env :
11- BUILD_ENGINE_BUILD_TAG : " build-engine-api:${{ github.run_number }}"
12- OTEL_BUILD_TAG : " build-engine-otel:${{ github.run_number }}"
13-
1413jobs :
1514 check :
1615 uses : " ./.github/workflows/setup.yml"
2221 outputs :
2322 DOCKER_TAG : ${{ steps.branch.outputs.DOCKER_TAG }}
2423 ECS_CLUSTER : ${{ steps.branch.outputs.ECS_CLUSTER }}
25- BUILD_ENGINE_BUILD_TAG : ${{ env.BUILD_ENGINE_BUILD_TAG }}
26- OTEL_BUILD_TAG : ${{ env.OTEL_BUILD_TAG }}
24+ BUILD_ENGINE_TAG : ${{ steps.push.outputs.BUILD_ENGINE_TAG }}
25+ OTEL_TAG : ${{ steps.push.outputs.OTEL_TAG }}
2726 if : ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }}
2827 steps :
2928 - name : Checkout
@@ -44,11 +43,16 @@ jobs:
4443 echo "ECS_CLUSTER=${ECS_CLUSTER}" >> $GITHUB_OUTPUT
4544
4645 - name : Build Docker images
46+ id : build
4747 run : |
48+ BUILD_ENGINE_BUILD_TAG="build-engine-api:${{ github.run_number }}"
49+ OTEL_BUILD_TAG="build-engine-otel:${{ github.run_number }}"
4850 echo "Building Docker images..."
49- docker build -t ${{ env. BUILD_ENGINE_BUILD_TAG}} .
50- docker build -t ${{ env. OTEL_BUILD_TAG}} -f Dockerfile.otel .
51+ docker build -t $BUILD_ENGINE_BUILD_TAG .
52+ docker build -t $OTEL_BUILD_TAG -f Dockerfile.otel .
5153 echo "Docker images built successfully."
54+ echo "BUILD_ENGINE_BUILD_TAG=${BUILD_ENGINE_BUILD_TAG}" >> $GITHUB_OUTPUT
55+ echo "BUILD_ENGINE_BUILD_TAG=${OTEL_BUILD_TAG}" >> $GITHUB_OUTPUT
5256
5357 - name : Login to GitHub Container Registry
5458 uses : docker/login-action@v2
@@ -58,12 +62,17 @@ jobs:
5862 password : ${{ secrets.GITHUB_TOKEN }}
5963
6064 - name : Push to GHCR
65+ id : push
6166 run : |
62- docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}
63- docker push ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}
67+ BUILD_ENGINE_TAG="sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}"
68+ docker tag ${{ steps.build.outputs.BUILD_ENGINE_BUILD_TAG }} ghcr.io/${BUILD_ENGINE_TAG}
69+ docker push ghcr.io/${BUILD_ENGINE_TAG}
70+ echo "BUILD_ENGINE_TAG=${BUILD_ENGINE_TAG}" >> $GITHUB_OUTPUT
6471
65- docker tag ${{ env.OTEL_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}
66- docker push ghcr.io/sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}
72+ OTEL_TAG="sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}"
73+ docker tag ${{ steps.build.outputs.OTEL_BUILD_TAG }} ghcr.io/${OTEL_TAG}
74+ docker push ghcr.io/${OTEL_TAG}
75+ echo "OTEL_TAG=${OTEL_TAG}" >> $GITHUB_OUTPUT
6776
6877 deploy-sil :
6978 needs : push-to-ghcr
7281 BUILD_NUMBER : ${{ github.run_number }}
7382 ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
7483 DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
75- BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
76- OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
84+ BUILD_ENGINE_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
85+ OTEL_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
7786 secrets :
7887 AWS_ACCESS_KEY_ID : ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
7988 AWS_SECRET_ACCESS_KEY : ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
8897 BUILD_NUMBER : ${{ github.run_number }}
8998 ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
9099 DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
91- BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
92- OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
100+ BUILD_ENGINE_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
101+ OTEL_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
93102 secrets :
94103 AWS_ACCESS_KEY_ID : ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
95104 AWS_SECRET_ACCESS_KEY : ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
@@ -103,8 +112,8 @@ jobs:
103112 BUILD_NUMBER : ${{ github.run_number }}
104113 ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
105114 DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
106- BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
107- OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
115+ BUILD_ENGINE_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_TAG }}
116+ OTEL_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_TAG }}
108117 secrets :
109118 AWS_ACCESS_KEY_ID : ${{ secrets.LU__AWS_ACCESS_KEY_ID }}
110119 AWS_SECRET_ACCESS_KEY : ${{ secrets.LU__AWS_SECRET_ACCESS_KEY }}
0 commit comments