From f3c4172e2fd8f4ecafce0b4642d90bbaac7634cb Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Fri, 25 Oct 2024 11:17:23 +0200 Subject: [PATCH] cleanup --- .github/workflows/ci-cd-prod.yml | 12 ++++++------ .github/workflows/ci-cd-staging.yml | 14 ++++++-------- .github/workflows/ci-cd-yt01.yml | 12 ++++++------ .github/workflows/workflow-check-for-changes.yml | 6 ++++-- ...ow-get-latest-deployed-versions-from-github.yml | 6 +++--- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci-cd-prod.yml b/.github/workflows/ci-cd-prod.yml index ef53a85bf..709b54ade 100644 --- a/.github/workflows/ci-cd-prod.yml +++ b/.github/workflows/ci-cd-prod.yml @@ -66,14 +66,14 @@ jobs: version: ${{ needs.get-current-version.outputs.version }} store-infra-version: - name: Store Infra Version as GitHub Variable + name: Store Latest Deployed Infra Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-infra, get-current-version] if: ${{ needs.deploy-infra.result == 'success' }} steps: - - name: Set GitHub variable for infra version + - name: Set GitHub variable for latest deployed infra version run: | - gh variable set INFRA_VERSION_PROD "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_INFRA_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env prod dry-run-deploy-apps: name: Dry run deploy apps to prod @@ -124,14 +124,14 @@ jobs: runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} store-apps-version: - name: Store Apps Version as GitHub Variable + name: Store Latest Deployed Apps Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-apps, get-current-version] if: ${{ needs.deploy-apps.result == 'success' }} steps: - - name: Set GitHub variable for apps version + - name: Set GitHub variable for latest deployed apps version run: | - gh variable set APPS_VERSION_PROD "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_APPS_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env prod deploy-slack-notifier: name: Deploy slack notifier (prod) diff --git a/.github/workflows/ci-cd-staging.yml b/.github/workflows/ci-cd-staging.yml index 0a9b334e9..3ef4cf881 100644 --- a/.github/workflows/ci-cd-staging.yml +++ b/.github/workflows/ci-cd-staging.yml @@ -47,14 +47,14 @@ jobs: version: ${{ needs.get-current-version.outputs.version }} store-infra-version: - name: Store Infra Version as GitHub Variable + name: Store Latest Deployed Infra Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-infra, get-current-version] if: ${{ needs.deploy-infra.result == 'success' }} steps: - - name: Set GitHub variable for infra version + - name: Set GitHub variable for latest deployed infra version run: | - gh variable set INFRA_VERSION_STAGING "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_INFRA_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env staging publish: name: Build and publish docker images @@ -71,14 +71,12 @@ jobs: name: Deploy apps to staging needs: [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 secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - # todo: consider resolving these in another way since they are created in the infra-step AZURE_RESOURCE_GROUP_NAME: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }} AZURE_ENVIRONMENT_KEY_VAULT_NAME: ${{ secrets.AZURE_ENVIRONMENT_KEY_VAULT_NAME }} AZURE_CONTAINER_APP_ENVIRONMENT_NAME: ${{ secrets.AZURE_CONTAINER_APP_ENVIRONMENT_NAME }} @@ -92,14 +90,14 @@ jobs: runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} store-apps-version: - name: Store Apps Version as GitHub Variable + name: Store Latest Deployed Apps Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-apps, get-current-version] if: ${{ needs.deploy-apps.result == 'success' }} steps: - - name: Set GitHub variable for apps version + - name: Set GitHub variable for latest deployed apps version run: | - gh variable set APPS_VERSION_STAGING "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_APPS_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env staging deploy-slack-notifier: name: Deploy slack notifier (staging) diff --git a/.github/workflows/ci-cd-yt01.yml b/.github/workflows/ci-cd-yt01.yml index abec54487..018f0831a 100644 --- a/.github/workflows/ci-cd-yt01.yml +++ b/.github/workflows/ci-cd-yt01.yml @@ -58,14 +58,14 @@ jobs: version: ${{ needs.get-current-version.outputs.version }} store-infra-version: - name: Store Infra Version as GitHub Variable + name: Store Latest Deployed Infra Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-infra, get-current-version] if: ${{ needs.deploy-infra.result == 'success' }} steps: - - name: Set GitHub variable for infra version + - name: Set GitHub variable for latest deployed infra version run: | - gh variable set INFRA_VERSION_YT01 "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_INFRA_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env yt01 deploy-apps: name: Deploy apps to yt01 @@ -92,14 +92,14 @@ jobs: runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} store-apps-version: - name: Store Apps Version as GitHub Variable + name: Store Latest Deployed Apps Version as GitHub Variable runs-on: ubuntu-latest needs: [deploy-apps, get-current-version] if: ${{ needs.deploy-apps.result == 'success' }} steps: - - name: Set GitHub variable for apps version + - name: Set GitHub variable for latest deployed apps version run: | - gh variable set APPS_VERSION_YT01 "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} + gh variable set LATEST_DEPLOYED_APPS_VERSION "${{ needs.get-current-version.outputs.version }}" --repo ${{ github.repository }} --env yt01 deploy-slack-notifier: name: Deploy slack notifier (yt01) diff --git a/.github/workflows/workflow-check-for-changes.yml b/.github/workflows/workflow-check-for-changes.yml index 3b541d733..514f12f2f 100644 --- a/.github/workflows/workflow-check-for-changes.yml +++ b/.github/workflows/workflow-check-for-changes.yml @@ -5,11 +5,13 @@ on: inputs: infra_base_sha: description: "Base SHA for infrastructure changes" - required: true + required: false + default: '' type: string apps_base_sha: description: "Base SHA for application changes" - required: true + required: false + default: '' type: string outputs: hasAzureChanges: diff --git a/.github/workflows/workflow-get-latest-deployed-versions-from-github.yml b/.github/workflows/workflow-get-latest-deployed-versions-from-github.yml index 4ba22320d..42dc521b3 100644 --- a/.github/workflows/workflow-get-latest-deployed-versions-from-github.yml +++ b/.github/workflows/workflow-get-latest-deployed-versions-from-github.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: environment: - description: "Environment to get latest deployed versions for (e.g., staging, prod)" + description: "Environment to get latest deployed versions for (e.g., staging, prod, yt01)" required: true type: string outputs: @@ -30,7 +30,7 @@ jobs: - name: Get Latest Deployed Infra Version id: get-infra-version - run: echo "version=$(gh variable get INFRA_VERSION_${{ inputs.environment }} --repo ${{ github.repository }} --json value --jq .value || echo '')" >> $GITHUB_OUTPUT + run: echo "version=$(gh variable get LATEST_DEPLOYED_INFRA_VERSION --repo ${{ github.repository }} --env ${{ inputs.environment }} --json value --jq .value || echo '')" >> $GITHUB_OUTPUT - name: Get Infra SHA id: get-infra-sha @@ -41,7 +41,7 @@ jobs: - name: Get Latest Deployed Apps Version id: get-apps-version - run: echo "version=$(gh variable get APPS_VERSION_${{ inputs.environment }} --repo ${{ github.repository }} --json value --jq .value || echo '')" >> $GITHUB_OUTPUT + run: echo "version=$(gh variable get LATEST_DEPLOYED_APPS_VERSION --repo ${{ github.repository }} --env ${{ inputs.environment }} --json value --jq .value || echo '')" >> $GITHUB_OUTPUT - name: Get Apps SHA id: get-apps-sha