Skip to content

Commit de37b68

Browse files
authored
Merge pull request #326 from QuantStrategyLab/ci/safe-cloud-run-cleanup
ci: retain Schwab rollback artifacts by default
2 parents 5b08c55 + 53f5be3 commit de37b68

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/sync-cloud-run-env.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
env:
3333
ENABLE_GITHUB_CLOUD_RUN_DEPLOY: ${{ vars.ENABLE_GITHUB_CLOUD_RUN_DEPLOY }}
3434
ENABLE_GITHUB_ENV_SYNC: ${{ vars.ENABLE_GITHUB_ENV_SYNC }}
35+
CLOUD_RUN_CLEANUP_ENABLED: ${{ vars.CLOUD_RUN_CLEANUP_ENABLED }}
3536
ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION: ${{ vars.ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION }}
3637
QSL_ENABLE_CLOUD_RUN_AUTOMATION: ${{ vars.QSL_ENABLE_CLOUD_RUN_AUTOMATION }}
3738
GCP_ARTIFACT_REGISTRY_HOSTNAME: ${{ vars.GCP_ARTIFACT_REGISTRY_HOSTNAME }}
@@ -242,6 +243,7 @@ jobs:
242243
fi
243244
244245
- name: Validate deploy inputs
246+
if: steps.config.outputs.deploy_enabled == 'true'
245247
run: |
246248
set -euo pipefail
247249
@@ -275,6 +277,7 @@ jobs:
275277

276278

277279
- name: Build, push, and deploy Cloud Run image
280+
if: steps.config.outputs.deploy_enabled == 'true'
278281
run: |
279282
set -euo pipefail
280283
@@ -1015,7 +1018,7 @@ jobs:
10151018
python3 scripts/reconcile_cloud_runtime.py cleanup-schedulers
10161019
10171020
- name: Prune old Cloud Run revisions
1018-
if: steps.config.outputs.enabled == 'true'
1021+
if: steps.config.outputs.deploy_enabled == 'true' && env.CLOUD_RUN_CLEANUP_ENABLED == 'true'
10191022
run: |
10201023
set -euo pipefail
10211024
@@ -1064,6 +1067,7 @@ jobs:
10641067
done
10651068
10661069
- name: Clean up old Cloud Run images
1070+
if: steps.config.outputs.deploy_enabled == 'true' && env.CLOUD_RUN_CLEANUP_ENABLED == 'true'
10671071
run: |
10681072
set -euo pipefail
10691073

0 commit comments

Comments
 (0)