Skip to content

Commit

Permalink
chore: add force rebuild images toggle to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Jun 19, 2024
1 parent 8c337e6 commit f889935
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@ on:
options:
- "enabled"
- "disabled"
forceRebuildDockerImages:
description: "Force rebuild the docker images"
required: false
type: choice
default: "false"
options:
- "true"
- "false"

env:
ENVIRONMENT: "beta"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "sanchogov.tools"
FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}}

jobs:
deploy:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ on:
options:
- "enabled"
- "disabled"
forceRebuildDockerImages:
description: "Force rebuild the docker images"
required: false
type: choice
default: "false"
options:
- "true"
- "false"

env:
ENVIRONMENT: "dev"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "dev-sanchonet.govtool.byron.network"
FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}}

jobs:
deploy:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ on:
options:
- "enabled"
- "disabled"
forceRebuildDockerImages:
description: "Force rebuild the docker images"
required: false
type: choice
default: "false"
options:
- "true"
- "false"

env:
ENVIRONMENT: "staging"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "staging.govtool.byron.network"
FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}}

jobs:
deploy:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ on:
options:
- "enabled"
- "disabled"
forceRebuildDockerImages:
description: "Force rebuild the docker images"
required: false
type: choice
default: "false"
options:
- "true"
- "false"

env:
ENVIRONMENT: "test"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "test-sanchonet.govtool.byron.network"
FORCE_REBUILD: ${{inputs.forceRebuildDockerImages == 'true'}}

jobs:
deploy:
Expand Down
9 changes: 7 additions & 2 deletions scripts/govtool/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ check_defined = \
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))


force_rebuild := $(shell echo $${FORCE_REBUILD:-})
# helper function for checking if image exists on ECR
check_image_on_ecr = \
$(docker) manifest inspect "$(repo_url)/$1:$2" > /dev/null 2>&1
if [ -n "$(force_rebuild)" ]; then \
false; \
else \
$(docker) manifest inspect "$(repo_url)/$1:$2" > /dev/null 2>&1; \
fi

.PHONY: check-env-defined
check-env-defined:
Expand Down

0 comments on commit f889935

Please sign in to comment.