Skip to content

Commit ff3d263

Browse files
committed
Update build.yaml
1 parent d6943dc commit ff3d263

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: "Release"
22
on:
33
workflow_dispatch:
44
inputs:
5-
environment:
6-
description: 'Environment'
7-
required: true
8-
default: 'dev'
9-
5+
build_flag:
6+
description: 'Docker Build Flags'
7+
default: ''
8+
type: choice
9+
options:
10+
- ''
11+
- '--no-cache'
12+
1013
jobs:
1114
build:
1215
runs-on: ubuntu-latest
@@ -37,7 +40,7 @@ jobs:
3740

3841
- name: Build and push
3942
run: |
40-
docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION}
43+
docker compose -f docker-compose.build.yml --env-file tdei_uw.env build --build-arg CODE_VERSION=${CODE_VERSION} {{github.event.inputs.build_flag}}
4144
docker compose -f docker-compose.build.yml --env-file tdei_uw.env push
4245
env:
4346
ENV: ${{ vars.ENV }}
@@ -88,13 +91,6 @@ jobs:
8891
docker context create dev --docker "host=ssh://github-actions@${{ vars.AZURE_DOCKER_HOST_IP }}"
8992
docker context use dev
9093
91-
# stop all running images, remove the containers, remove the images
92-
# why? in case we're rebuilding the image of the same commit, we want to ensure the newer image is deployed
93-
# in case the last one was corrupted for some reason--just to avoid any questions about deployment reliability
94-
#docker stop $(docker ps -q)
95-
#docker rm -v $(docker ps --filter status=exited -q)
96-
#docker rmi $(docker images -q)
97-
9894
# remove images no longer in use--may need disk space to pull
9995
echo Pruning old docker images
10096
docker image prune -a -f
@@ -103,8 +99,10 @@ jobs:
10399
docker compose -f docker-compose.deploy.yml --env-file tdei_uw.env up -d --force-recreate --remove-orphans
104100
105101
# check what was deployed, just to save in the GH logs
106-
echo Waiting for deployment to complete; listing deployed artifacts
102+
echo Waiting for deployment to complete
107103
sleep 30s
104+
105+
echo Deploy list
108106
docker ps
109107
110108

0 commit comments

Comments
 (0)