Skip to content

Commit 1b4445b

Browse files
committed
Update build.yaml
1 parent 697a647 commit 1b4445b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ jobs:
8383
ref: refs/tags/${{github.event.inputs.env}}
8484
- run: cd tasking-manager; echo TM_VERSION=`/usr/bin/git log -1 --format='%h'` >> "$GITHUB_ENV"
8585

86-
8786
# leaderboard submod
8887
- name: Checkout leaderboard
8988
uses: actions/checkout@v2
@@ -93,7 +92,6 @@ jobs:
9392
ref: refs/tags/${{github.event.inputs.env}}
9493
- run: cd leaderboard; echo LB_VERSION=`/usr/bin/git log -1 --format='%h'` >> "$GITHUB_ENV"
9594

96-
9795
- uses: docker/login-action@v3
9896
with:
9997
registry: ${{ vars.WS_DOCKER_REGISTRY }}
@@ -115,9 +113,23 @@ jobs:
115113

116114
- name: Build and push
117115
run: |
118-
docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION} ${{github.event.inputs.build_flag}}
119-
docker compose -f docker-compose.build.yml --env-file tdei_uw.env push
120-
116+
set -x
117+
118+
for IMAGE_PATH in `docker compose -f docker-compose.build.yml config --images`;
119+
do
120+
IMAGE_NAME=`echo ${IMAGE_PATH} | cut -d '/' -f 2`
121+
TAG="$CODE_VERSION"
122+
123+
if [ $(az acr repository show-tags --name opensidewalksdev --repository $image | grep -o $TAG) == "$TAG" ]; then
124+
echo "Image already exists for $IMAGE_PATH, not building again"
125+
else
126+
echo "Image does not exist at $IMAGE_PATH, building and pushing"
127+
128+
#docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION} ${{github.event.inputs.build_flag}}
129+
#docker compose -f docker-compose.build.yml --env-file tdei_uw.env push
130+
fi
131+
done
132+
121133
env:
122134
ENV: ${{ vars.ENV }}
123135
CODE_VERSION: "${{ env.FRONTEND_VERSION }}-${{ env.CGIMAP_VERSION }}-${{ env.OSMRAILS_VERSION }}-${{ env.PATHWAYS_VERSION }}-${{ env.RAPID_VERSION }}-${{ env.TM_VERSION }}-${{ env.LB_VERSION }}"

0 commit comments

Comments
 (0)