Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Oct 25, 2024
1 parent 8400999 commit f3c4172
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/ci-cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-cd-yt01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/workflow-check-for-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f3c4172

Please sign in to comment.