1616 - cron : " 0 0 * * 0" # weekly
1717
1818env :
19- BUILD_TAG : " build-engine-api:${{ github.sha }}"
19+ BUILD_TAG : " build-engine-api:${{ github.run_number }}"
20+ BUILD_NUMBER : ${{ github.run_number }}
2021
2122jobs :
2223 build :
@@ -94,20 +95,19 @@ jobs:
9495 - name : Push to AWS ECR (SIL)
9596 run : |
9697 docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
97- docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
98+ docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
9899 docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
99- docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
100+ docker push "${{ steps.ecr_sil.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
100101
101102 - name : Deploy to ECS (SIL)
102103 if : ${{ steps.branch.outputs.EcsCluster != 'none' }}
103104 run : |
104- echo "Deploying ${{ github.sha }} to ${{ steps.branch.outputs.EcsCluster }}"
105+ echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
105106 # Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
106- ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ github.sha }} --max-definitions 20 --timeout 600
107+ ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
107108 echo "Deployment initiated successfully."
108109
109110 - name : Configure AWS credentials (FCBH)
110- if : false # Temporarily disabled - remove this line to re-enable
111111 id : aws_fcbh
112112 uses : aws-actions/configure-aws-credentials@v4
113113 with :
@@ -116,27 +116,25 @@ jobs:
116116 aws-region : ${{ secrets.FCBH__AWS_DEFAULT_REGION }}
117117
118118 - name : Login to AWS ECR (FCBH)
119- if : false # Temporarily disabled - remove this line to re-enable
120119 id : ecr_fcbh
121120 uses : aws-actions/amazon-ecr-login@v2
122121 with :
123122 registries : ${{ secrets.FCBH__AWS_ECR_ACCOUNT }}
124123
125124 - name : Push to AWS ECR (FCBH)
126- if : false # Temporarily disabled - remove this line to re-enable
127125 run : |
128126 docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
129- docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
127+ docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
130128 docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
131- docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
129+ docker push "${{ steps.ecr_fcbh.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
132130
133131 - name : Deploy to ECS (FCBH)
134132 if : false # Temporarily disabled - remove this line to re-enable
135133 # if: ${{ steps.branch.outputs.EcsCluster == 'scriptoria-prd' }} # Restore this when re-enabling
136134 run : |
137- echo "Deploying ${{ github.sha }} to ${{ steps.branch.outputs.EcsCluster }}"
135+ echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
138136 # Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
139- ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ github.sha }} --max-definitions 20 --timeout 600
137+ ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
140138 echo "Deployment initiated successfully."
141139
142140 - name : Configure AWS credentials (LU)
@@ -148,24 +146,26 @@ jobs:
148146 aws-region : ${{ secrets.LU__AWS_DEFAULT_REGION }}
149147
150148 - name : Login to AWS ECR (LU)
149+ if : ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
151150 id : ecr_lu
152151 uses : aws-actions/amazon-ecr-login@v2
153152 with :
154153 registries : ${{ secrets.LU__AWS_ECR_ACCOUNT }}
155154
156155 - name : Push to AWS ECR (LU)
156+ if : ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
157157 run : |
158158 docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
159- docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
159+ docker tag ${{ env.BUILD_TAG }} "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
160160 docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ steps.branch.outputs.DockerTag }}"
161- docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ github.sha }}"
161+ docker push "${{ steps.ecr_lu.outputs.registry }}/appbuilder-buildengine-api:${{ env.BUILD_NUMBER }}"
162162
163163 - name : Deploy to ECS (LU)
164164 if : ${{ steps.branch.outputs.EcsCluster == 'scriptoria-stg' }}
165165 run : |
166- echo "Deploying ${{ github.sha }} to ${{ steps.branch.outputs.EcsCluster }}"
166+ echo "Deploying ${{ env.BUILD_NUMBER }} to ${{ steps.branch.outputs.EcsCluster }}"
167167 # Deploy to ECS cluster with service name 'build-engine', setting all images to the latest tag
168- ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ github.sha }} --max-definitions 20 --timeout 600
168+ ecs-deploy -c ${{ steps.branch.outputs.EcsCluster }} -n buildengine -i ignore -to ${{ env.BUILD_NUMBER }} --max-definitions 20 --timeout 600
169169 echo "Deployment initiated successfully."
170170
171171 - name : Clean up older packages
0 commit comments