Skip to content

Commit

Permalink
Bugfix: CD dispatch should dispatch to dh3-environments (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerbou authored Dec 13, 2024
1 parent 284ef9c commit d00f75d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
51 changes: 40 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,40 @@ jobs:
# CD .NET
#

dotnet_promote_prerelease:
promote_prerelease_core:
needs: changes
if: ${{ needs.changes.outputs.nuget_packages == 'true'}}
if: ${{ fromJson(needs.changes.outputs.job_context).core == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/promote-prerelease.yml@v14
with:
release_name_prefix: dotnet
release_name_prefix: process_manager_core

promote_prerelease_orchestrations:
needs: changes
if: ${{ fromJson(needs.changes.outputs.job_context).orchestrations == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/promote-prerelease.yml@v14
with:
release_name_prefix: process_manager_orchestrations

promote_prerelease_dbmigrations:
needs: changes
if: ${{ fromJson(needs.changes.outputs.job_context).dbmigrations == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/promote-prerelease.yml@v14
with:
release_name_prefix: process_manager_dbmigrations


#
# Dispatch deployment request
# Only dispatch if there are changes to either dotnet or database migrations. No need to deploy if only C4 model views are updated.
#

dispatch_deploment_event_core:
if: ${{ fromJson(needs.changes.outputs.job_context).core == 'true' }}
if: ${{ fromJson(needs.changes.outputs.job_context).core == 'true' }}
runs-on: ubuntu-latest
needs: [dotnet_promote_prerelease, changes]
needs: [
changes,
promote_prerelease_core
]
steps:
- name: Find associated pull request
uses: Energinet-DataHub/.github/.github/actions/find-related-pr-number@v14
Expand All @@ -70,9 +88,12 @@ jobs:
client-payload: '{"pr_number": "${{ steps.find_pull_request.outputs.pull_request_number }}" }' # yamllint disable-line rule:quoted-strings

dispatch_deploment_event_orchestrations:
if: ${{ fromJson(needs.changes.outputs.job_context).orchestrations == 'true' }}
if: ${{ fromJson(needs.changes.outputs.job_context).orchestrations == 'true' }}
runs-on: ubuntu-latest
needs: [dotnet_promote_prerelease, changes]
needs: [
changes,
promote_prerelease_orchestrations
]
steps:
- name: Find associated pull request
uses: Energinet-DataHub/.github/.github/actions/find-related-pr-number@v14
Expand All @@ -94,9 +115,12 @@ jobs:
client-payload: '{"pr_number": "${{ steps.find_pull_request.outputs.pull_request_number }}"}' # yamllint disable-line rule:quoted-strings

dispatch_deploment_event_dbmigrations:
if: ${{ fromJson(needs.changes.outputs.job_context).orchestrations == 'true' }}
if: ${{ fromJson(needs.changes.outputs.job_context).dbmigrations == 'true' }}
runs-on: ubuntu-latest
needs: [dotnet_promote_prerelease, changes]
needs: [
changes,
promote_prerelease_dbmigrations
]
steps:
- name: Find associated pull request
uses: Energinet-DataHub/.github/.github/actions/find-related-pr-number@v14
Expand All @@ -123,8 +147,13 @@ jobs:

dispatch_failed:
needs: [
dotnet_promote_prerelease,

changes,
promote_prerelease_core,
promote_prerelease_orchestrations,
promote_prerelease_dbmigrations,
dispatch_deploment_event_core,
dispatch_deploment_event_orchestrations,
dispatch_deploment_event_dbmigrations
]
if: |
always() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Energinet.DataHub.ProcessManagement.Core.Domain.OrchestrationDescripti
/// <summary>
/// Durable Functions orchestration description.
/// It contains the information necessary to locate and execute a Durable Functions
/// orchestration.
/// orchestration
/// </summary>
public class OrchestrationDescription
{
Expand Down

0 comments on commit d00f75d

Please sign in to comment.