99
1010env :
1111 BUILD_ENGINE_BUILD_TAG : " build-engine-api:${{ github.run_number }}"
12- OTEL_BUILD_TAG : " scriptoria -otel:${{ github.run_number }}"
12+ OTEL_BUILD_TAG : " build-engine -otel:${{ github.run_number }}"
1313
1414jobs :
1515 check :
1616 uses : " ./.github/workflows/setup.yml"
1717 secrets :
1818 AUTH0_SECRET : ${{ secrets.AUTH0_SECRET }}
19- deploy -to-ecr :
19+ push -to-ghcr :
2020 runs-on : ubuntu-latest
2121 needs : check
22+ outputs :
23+ DOCKER_TAG : ${{ steps.branch.outputs.DOCKER_TAG }}
24+ 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 }}
2227 if : ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }}
2328 steps :
2429 - name : Checkout
4146 uses : docker/build-push-action@v4
4247 with :
4348 push : false
44- tags : ${{ env.BUILD_ENGINE_BUILD_TAG }}
49+ tags : ${{ env.OTEL_BUILD_TAG }}
4550 context : .
4651 load : true
4752 file : Dockerfile.otel
5257 if [[ "${GITHUB_HEAD_REF}" != "" ]]; then BRANCH="${GITHUB_HEAD_REF}"; else BRANCH="${GITHUB_REF_NAME}"; fi
5358 case $BRANCH in develop) DOCKER_TAG="staging" ;; master) DOCKER_TAG="production" ;; *) DOCKER_TAG="${BRANCH//\//-}" ;; esac
5459 case $BRANCH in develop) ECS_CLUSTER="scriptoria-stg";; master) ECS_CLUSTER="scriptoria-prd" ;; *) ECS_CLUSTER="none" ;; esac
55- echo "DockerTag =${DOCKER_TAG}" >> $GITHUB_OUTPUT
56- echo "EcsCluster =${ECS_CLUSTER}" >> $GITHUB_OUTPUT
60+ echo "DOCKER_TAG =${DOCKER_TAG}" >> $GITHUB_OUTPUT
61+ echo "ECS_CLUSTER =${ECS_CLUSTER}" >> $GITHUB_OUTPUT
5762
5863 - name : Login to GitHub Container Registry
5964 uses : docker/login-action@v2
@@ -64,56 +69,55 @@ jobs:
6469
6570 - name : Push to GHCR
6671 run : |
67- docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}
68- docker push ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}
69- # push OTEL???
70-
71- - name : Deploy SIL
72- uses : " ./.github/workflows/deploy.yml"
73- with :
74- BUILD_NUMBER : ${{ github.run_number }}
75- ECS_CLUSTER : ${{ steps.branch.outputs.EcsCluster }}
76- DOCKER_TAG : ${{ steps.branch.outputs.DockerTag }}
77- BUILD_ENGINE_BUILD_TAG : ${{ env.BUILD_ENGINE_BUILD_TAG }}
78- OTEL_BUILD_TAG : ${{ env.OTEL_BUILD_TAG }}
79- AWS_ACCESS_KEY_ID : ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
80- AWS_SECRET_ACCESS_KEY : ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
81- AWS_DEFAULT_REGION : ${{ secrets.SIL__AWS_DEFAULT_REGION }}
82- AWS_ECR_ACCOUNT : ${{ secrets.SIL__AWS_ECR_ACCOUNT }}
72+ docker tag ${{ env.BUILD_ENGINE_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}
73+ docker push ghcr.io/sillsdev/appbuilder-buildengine-api:${{ steps.branch.outputs.DOCKER_TAG }}
8374
84- - name : Deploy FCBH
85- if : false # Temporarily disabled - remove this line to re-enable
86- # if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
87- uses : " ./.github/workflows/deploy.yml"
88- with :
89- BUILD_NUMBER : ${{ github.run_number }}
90- ECS_CLUSTER : ${{ steps.branch.outputs.EcsCluster }}
91- DOCKER_TAG : ${{ steps.branch.outputs.DockerTag }}
92- BUILD_ENGINE_BUILD_TAG : ${{ env.BUILD_ENGINE_BUILD_TAG }}
93- OTEL_BUILD_TAG : ${{ env.OTEL_BUILD_TAG }}
94- AWS_ACCESS_KEY_ID : ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
95- AWS_SECRET_ACCESS_KEY : ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
96- AWS_DEFAULT_REGION : ${{ secrets.FCBH__AWS_DEFAULT_REGION }}
97- AWS_ECR_ACCOUNT : ${{ secrets.FCBH__AWS_ECR_ACCOUNT }}
98-
99- - name : Deploy LU
100- if : ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
101- uses : " ./.github/workflows/deploy.yml"
102- with :
103- BUILD_NUMBER : ${{ github.run_number }}
104- ECS_CLUSTER : ${{ steps.branch.outputs.EcsCluster }}
105- DOCKER_TAG : ${{ steps.branch.outputs.DockerTag }}
106- BUILD_ENGINE_BUILD_TAG : ${{ env.BUILD_ENGINE_BUILD_TAG }}
107- OTEL_BUILD_TAG : ${{ env.OTEL_BUILD_TAG }}
108- AWS_ACCESS_KEY_ID : ${{ secrets.LU__AWS_ACCESS_KEY_ID }}
109- AWS_SECRET_ACCESS_KEY : ${{ secrets.LU__AWS_SECRET_ACCESS_KEY }}
110- AWS_DEFAULT_REGION : ${{ secrets.LU__AWS_DEFAULT_REGION }}
111- AWS_ECR_ACCOUNT : ${{ secrets.LU__AWS_ECR_ACCOUNT }}
75+ docker tag ${{ env.OTEL_BUILD_TAG }} ghcr.io/sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}
76+ docker push ghcr.io/sillsdev/appbuilder-buildengine-otel:${{ steps.branch.outputs.DOCKER_TAG }}
11277
113- - name : Clean up older packages
114- uses : actions/delete-package-versions@v4
115- with :
116- package-name : " appbuilder-buildengine-api"
117- package-type : " container"
118- min-versions-to-keep : 6
119- delete-only-untagged-versions : " true"
78+ deploy-sil :
79+ needs : push-to-ghcr
80+ if : ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }}
81+ uses : " ./.github/workflows/deploy.yml"
82+ with :
83+ BUILD_NUMBER : ${{ github.run_number }}
84+ ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
85+ DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
86+ BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
87+ OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
88+ secrets :
89+ AWS_ACCESS_KEY_ID : ${{ secrets.SIL__AWS_ACCESS_KEY_ID }}
90+ AWS_SECRET_ACCESS_KEY : ${{ secrets.SIL__AWS_SECRET_ACCESS_KEY }}
91+ AWS_DEFAULT_REGION : ${{ secrets.SIL__AWS_DEFAULT_REGION }}
92+ AWS_ECR_ACCOUNT : ${{ secrets.SIL__AWS_ECR_ACCOUNT }}
93+ deploy-fcbh :
94+ needs : push-to-ghcr
95+ if : false # Temporarily disabled - remove this line to re-enable
96+ # if: ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && needs.push-to-ghcr.outputs.ECS_CLUSTER == 'scriptoria-prd' }} # Restore this when re-enabling
97+ uses : " ./.github/workflows/deploy.yml"
98+ with :
99+ BUILD_NUMBER : ${{ github.run_number }}
100+ ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
101+ DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
102+ BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
103+ OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
104+ secrets :
105+ AWS_ACCESS_KEY_ID : ${{ secrets.FCBH__AWS_ACCESS_KEY_ID }}
106+ AWS_SECRET_ACCESS_KEY : ${{ secrets.FCBH__AWS_SECRET_ACCESS_KEY }}
107+ AWS_DEFAULT_REGION : ${{ secrets.FCBH__AWS_DEFAULT_REGION }}
108+ AWS_ECR_ACCOUNT : ${{ secrets.FCBH__AWS_ECR_ACCOUNT }}
109+ deploy-lu :
110+ needs : push-to-ghcr
111+ if : ${{ success() && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && needs.push-to-ghcr.outputs.ECS_CLUSTER == 'scriptoria-stg' }}
112+ uses : " ./.github/workflows/deploy.yml"
113+ with :
114+ BUILD_NUMBER : ${{ github.run_number }}
115+ ECS_CLUSTER : ${{ needs.push-to-ghcr.outputs.ECS_CLUSTER }}
116+ DOCKER_TAG : ${{ needs.push-to-ghcr.outputs.DOCKER_TAG }}
117+ BUILD_ENGINE_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.BUILD_ENGINE_BUILD_TAG }}
118+ OTEL_BUILD_TAG : ${{ needs.push-to-ghcr.outputs.OTEL_BUILD_TAG }}
119+ secrets :
120+ AWS_ACCESS_KEY_ID : ${{ secrets.LU__AWS_ACCESS_KEY_ID }}
121+ AWS_SECRET_ACCESS_KEY : ${{ secrets.LU__AWS_SECRET_ACCESS_KEY }}
122+ AWS_DEFAULT_REGION : ${{ secrets.LU__AWS_DEFAULT_REGION }}
123+ AWS_ECR_ACCOUNT : ${{ secrets.LU__AWS_ECR_ACCOUNT }}
0 commit comments