Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: rename jobs to something generic #1292

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/ci-cd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
dockerImageBaseName: ghcr.io/digdir/dialogporten-
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}

deploy-infra-test:
deploy-infra:
name: Deploy infra to test
needs: [get-current-version, check-for-changes, generate-git-short-sha]
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasAzureChanges == 'true' }}
Expand All @@ -78,15 +78,15 @@ jobs:
region: norwayeast
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}

deploy-apps-test:
deploy-apps:
name: Deploy apps to test
needs:
[
get-current-version,
check-for-changes,
generate-git-short-sha,
publish,
deploy-infra-test,
deploy-infra,
]
# we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
Expand All @@ -107,7 +107,7 @@ jobs:
version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }}
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}

deploy-slack-notifier-test:
deploy-slack-notifier:
name: Deploy slack notifier (test)
needs: [check-for-changes]
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }}
Expand All @@ -125,7 +125,7 @@ jobs:

publish-schema-npm:
name: Deploy schema npm package
needs: [check-for-changes, get-current-version, generate-git-short-sha, deploy-apps-test]
needs: [check-for-changes, get-current-version, generate-git-short-sha, deploy-apps]
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }}
uses: ./.github/workflows/workflow-publish-schema.yml
with:
Expand All @@ -137,7 +137,7 @@ jobs:
name: "Run K6 functional end-to-end tests"
# we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true') }}
needs: [deploy-apps-test, check-for-changes]
needs: [deploy-apps, check-for-changes]
uses: ./.github/workflows/workflow-run-k6-tests.yml
secrets:
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
Expand All @@ -153,9 +153,9 @@ jobs:
send-slack-message-on-failure:
name: Send Slack message on failure
needs: [
deploy-infra-test,
deploy-apps-test,
deploy-slack-notifier-test,
deploy-infra,
deploy-apps,
deploy-slack-notifier,
run-e2e-tests,
publish-schema-npm,
publish,
Expand All @@ -165,9 +165,9 @@ jobs:
uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml
with:
environment: test
infra_status: ${{ needs.deploy-infra-test.result }}
apps_status: ${{ needs.deploy-apps-test.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier-test.result }}
infra_status: ${{ needs.deploy-infra.result }}
apps_status: ${{ needs.deploy-apps.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier.result }}
e2e_tests_status: ${{ needs.run-e2e-tests.result }}
schema_npm_status: ${{ needs.publish-schema-npm.result }}
publish_status: ${{ needs.publish.result }}
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/ci-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Get current version
uses: ./.github/workflows/workflow-get-current-version.yml

dry-run-deploy-infra-prod:
dry-run-deploy-infra:
name: Dry run deploy infra to prod
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasAzureChanges == 'true' }}
needs: [get-current-version, check-for-changes]
Expand All @@ -38,10 +38,10 @@ jobs:
version: ${{ needs.get-current-version.outputs.version }}
dryRun: true

deploy-infra-prod:
deploy-infra:
name: Deploy infra to prod
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasAzureChanges == 'true' }}
needs: [get-current-version, check-for-changes, dry-run-deploy-infra-prod]
needs: [get-current-version, check-for-changes, dry-run-deploy-infra]
uses: ./.github/workflows/workflow-deploy-infra.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
Expand All @@ -56,10 +56,10 @@ jobs:
region: norwayeast
version: ${{ needs.get-current-version.outputs.version }}

dry-run-deploy-apps-prod:
dry-run-deploy-apps:
name: Dry run deploy apps to prod
needs:
[get-current-version, check-for-changes, deploy-infra-prod]
[get-current-version, check-for-changes, deploy-infra]
# we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to dry-run deploy the apps
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
uses: ./.github/workflows/workflow-deploy-apps.yml
Expand All @@ -80,10 +80,10 @@ jobs:
dryRun: true
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}

deploy-apps-prod:
deploy-apps:
name: Deploy apps to prod
needs:
[get-current-version, check-for-changes, dry-run-deploy-apps-prod]
[get-current-version, check-for-changes, dry-run-deploy-apps]
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' }}
uses: ./.github/workflows/workflow-deploy-apps.yml
secrets:
Expand All @@ -102,7 +102,7 @@ jobs:
version: ${{ needs.get-current-version.outputs.version }}
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}

deploy-slack-notifier-prod:
deploy-slack-notifier:
name: Deploy slack notifier (prod)
needs: [check-for-changes]
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }}
Expand All @@ -122,7 +122,7 @@ jobs:
# name: "Run K6 functional end-to-end tests"
# # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests
# if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
# needs: [deploy-apps-prod, check-for-changes]
# needs: [deploy-apps, check-for-changes]
# uses: ./.github/workflows/workflow-run-k6-tests.yml
# secrets:
# TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
Expand All @@ -137,14 +137,14 @@ jobs:

send-slack-message-on-failure:
name: Send Slack message on failure
needs: [deploy-infra-prod, deploy-apps-prod, deploy-slack-notifier-prod]
needs: [deploy-infra, deploy-apps, deploy-slack-notifier]
if: ${{ always() && failure() && !cancelled() }}
uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml
with:
environment: prod
infra_status: ${{ needs.deploy-infra-prod.result }}
apps_status: ${{ needs.deploy-apps-prod.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier-prod.result }}
infra_status: ${{ needs.deploy-infra.result }}
apps_status: ${{ needs.deploy-apps.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier.result }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID_FOR_CI_CD_STATUS }}
20 changes: 10 additions & 10 deletions .github/workflows/ci-cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
dockerImageBaseName: ghcr.io/digdir/dialogporten-
version: ${{ needs.get-current-version.outputs.version }}

deploy-infra-staging:
deploy-infra:
name: Deploy infra to staging
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasAzureChanges == 'true' }}
needs: [get-current-version, check-for-changes]
Expand All @@ -48,10 +48,10 @@ jobs:
region: norwayeast
version: ${{ needs.get-current-version.outputs.version }}

deploy-apps-staging:
deploy-apps:
name: Deploy apps to staging
needs:
[get-current-version, check-for-changes, deploy-infra-staging, publish]
[get-current-version, check-for-changes, deploy-infra, publish]
# we want deployment of apps to be dependent on deployment of infrastructure, but if infrastructure is skipped, we still want to deploy the apps
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
uses: ./.github/workflows/workflow-deploy-apps.yml
Expand All @@ -71,7 +71,7 @@ jobs:
version: ${{ needs.get-current-version.outputs.version }}
runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }}

deploy-slack-notifier-staging:
deploy-slack-notifier:
name: Deploy slack notifier (staging)
needs: [check-for-changes]
if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }}
Expand All @@ -89,7 +89,7 @@ jobs:

publish-schema-npm:
name: Publish schema npm package
needs: [check-for-changes, get-current-version, deploy-apps-staging]
needs: [check-for-changes, get-current-version, deploy-apps]
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }}
uses: ./.github/workflows/workflow-publish-schema.yml
with:
Expand All @@ -101,7 +101,7 @@ jobs:
name: "Run K6 functional end-to-end tests"
# we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests
if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }}
needs: [deploy-apps-staging, check-for-changes]
needs: [deploy-apps, check-for-changes]
uses: ./.github/workflows/workflow-run-k6-tests.yml
secrets:
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
Expand All @@ -116,14 +116,14 @@ jobs:

send-slack-message-on-failure:
name: Send Slack message on failure
needs: [deploy-infra-staging, deploy-apps-staging, deploy-slack-notifier-staging, run-e2e-tests, publish-schema-npm, publish]
needs: [deploy-infra, deploy-apps, deploy-slack-notifier, run-e2e-tests, publish-schema-npm, publish]
if: ${{ always() && failure() && !cancelled() }}
uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml
with:
environment: staging
infra_status: ${{ needs.deploy-infra-staging.result }}
apps_status: ${{ needs.deploy-apps-staging.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier-staging.result }}
infra_status: ${{ needs.deploy-infra.result }}
apps_status: ${{ needs.deploy-apps.result }}
slack_notifier_status: ${{ needs.deploy-slack-notifier.result }}
e2e_tests_status: ${{ needs.run-e2e-tests.result }}
schema_npm_status: ${{ needs.publish-schema-npm.result }}
publish_status: ${{ needs.publish.result }}
Expand Down
Loading