Skip to content

Commit

Permalink
updated ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
cenh-halfspace committed Jan 2, 2025
1 parent 3dcaa7e commit b9a8ed5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,26 @@ jobs:
with:
release_name_prefix: dotnet

#
# CD Databricks
#

databricks_promote_prerelease:
needs: changes
if: ${{ needs.changes.outputs.databricks == 'true' }}
uses: Energinet-DataHub/.github/.github/workflows/promote-prerelease.yml@v14
with:
release_name_prefix: databricks

#
# 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:
if: ${{ needs.changes.outputs.dotnet == 'true' || needs.changes.outputs.db_migrations == 'true' }}
if: ${{ needs.changes.outputs.dotnet == 'true' || needs.changes.outputs.db_migrations == 'true' || needs.changes.outputs.databricks == 'true' }}
runs-on: ubuntu-latest
needs: [changes, dotnet_promote_prerelease]
needs: [changes, dotnet_promote_prerelease, databricks_promote_prerelease]
steps:
- name: Find associated pull request
uses: Energinet-DataHub/.github/.github/actions/find-related-pr-number@v13
Expand All @@ -66,7 +77,7 @@ jobs:
repository: ${{ vars.environment_repository_path }}
event-type: settlement-report-deployment-request-domain
# yamllint disable-line rule:quoted-strings
client-payload: '{"pr_number": "${{ steps.find_pull_request.outputs.pull_request_number }}", "dotnet": "${{ needs.changes.outputs.dotnet }}", "db_migrations": "${{ needs.changes.outputs.db_migrations }}"}'
client-payload: '{"pr_number": "${{ steps.find_pull_request.outputs.pull_request_number }}", "dotnet": "${{ needs.changes.outputs.dotnet }}", "db_migrations": "${{ needs.changes.outputs.db_migrations }}", "databricks": "${{ needs.changes.outputs.databricks }}"}'

#
# Send notification to teams channel if deployment dispatch failed
Expand All @@ -77,6 +88,7 @@ jobs:
[
dotnet_promote_prerelease,
dispatch_deploment_event,
databricks_promote_prerelease,
]
if: |
always() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ jobs:

# Check executed unit tests
settlement_report_unit_test_check:
if: ${{ inputs.has_calculator_job_changes }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
if: ${{ needs.changes.outputs.dotnet == 'true' || needs.changes.outputs.db_migrations == 'true' }}
uses: ./.github/workflows/ci-dotnet.yml

ci_python:
ci_databricks:
needs: [changes, ci_docker]
if: ${{ needs.changes.outputs.settlement_report_job == 'true' }}
uses: ./.github/workflows/ci-python.yml
if: ${{ needs.changes.outputs.databricks == 'true' }}
uses: ./.github/workflows/ci-databricks.yml
with:
image_tag: ${{ needs.ci_docker.outputs.image_tag }}

Expand All @@ -75,6 +75,7 @@ jobs:
changes,
ci_base,
ci_dotnet,
ci_databricks,
render_c4model_views,
]
if: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/detect-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
dotnet: ${{ steps.filter.outputs.dotnet }}
render_c4model_views: ${{ steps.filter.outputs.render_c4model_views }}
db_migrations: ${{ steps.filter.outputs.db_migrations }}
settlement_report_job: ${{ steps.filter.outputs.settlement_report_job }}
databricks: ${{ steps.filter.outputs.databricks }}
docker: ${{ steps.filter.outputs.docker }}
docker_in_commit: ${{ steps.docker_changed.outputs.any_changed }}
steps:
Expand All @@ -70,7 +70,7 @@ jobs:
- 'docs/diagrams/c4-model/views.dsl'
- 'docs/diagrams/c4-model/views.json'
- 'docs/diagrams/c4-model/model.dsl'
settlement_report_job:
databricks:
- 'source/settlement_report_python/**'
docker:
- .docker/**
Expand Down

0 comments on commit b9a8ed5

Please sign in to comment.