Skip to content

Commit c6a1a18

Browse files
authored
ci: ensure version is stored when deploying apps (#1481)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> There is a case where if the migration deployment was skipped, the whole deploy-apps workflow status will also be "skipped". This results in that the store-apps-version will never get run. Rather storing the deployment status excplicitly in the deploy-apps workflow instead. ## Related Issue(s) - #{issue number} ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced CI/CD workflows for production, staging, and YT01 with improved job execution conditions, allowing for more resilient deployments and testing. - Introduced a new output variable `deployment_executed` to indicate the success of deployments. - **Bug Fixes** - Adjusted conditions for running end-to-end tests to ensure they execute under broader circumstances. - **Documentation** - Updated workflow configurations to reflect the new job parameters and outputs for better clarity on deployment processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 3d647da commit c6a1a18

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.github/workflows/ci-cd-prod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
store-apps-version:
131131
name: Store Latest Deployed Apps Version as GitHub Variable
132132
needs: [deploy-apps, get-current-version]
133-
if: ${{ needs.deploy-apps.result == 'success' }}
133+
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.deploy-apps.outputs.deployment_executed == 'true') }}
134134
uses: ./.github/workflows/workflow-store-github-env-variable.yml
135135
with:
136136
variable_name: LATEST_DEPLOYED_APPS_VERSION

.github/workflows/ci-cd-staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
store-apps-version:
9797
name: Store Latest Deployed Apps Version as GitHub Variable
9898
needs: [deploy-apps, get-current-version]
99-
if: ${{ needs.deploy-apps.result == 'success' }}
99+
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.deploy-apps.outputs.deployment_executed == 'true') }}
100100
uses: ./.github/workflows/workflow-store-github-env-variable.yml
101101
with:
102102
variable_name: LATEST_DEPLOYED_APPS_VERSION

.github/workflows/ci-cd-yt01.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
store-apps-version:
9999
name: Store Latest Deployed Apps Version as GitHub Variable
100100
needs: [deploy-apps, get-current-version]
101-
if: ${{ needs.deploy-apps.result == 'success' }}
101+
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.deploy-apps.outputs.deployment_executed == 'true') }}
102102
uses: ./.github/workflows/workflow-store-github-env-variable.yml
103103
with:
104104
variable_name: LATEST_DEPLOYED_APPS_VERSION

.github/workflows/workflow-deploy-apps.yml

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ env:
33
AZ_CLI_VERSION: 2.64.0
44
on:
55
workflow_call:
6+
outputs:
7+
deployment_executed:
8+
description: "Indicates if the deployment was actually executed"
9+
value: ${{ jobs.deploy-apps.result == 'success' && jobs.deploy-jobs.result == 'success' && !inputs.dryRun }}
610
secrets:
711
AZURE_CLIENT_ID:
812
required: true

0 commit comments

Comments
 (0)