From 44c7d867fb019757b65c701fa2f7080c68864383 Mon Sep 17 00:00:00 2001 From: acouch Date: Tue, 14 May 2024 15:57:49 -0400 Subject: [PATCH] Delete CD workflow files --- .github/workflows/cd-analytics-infra.yml | 68 ------------------------ .github/workflows/cd-analytics.yml | 41 -------------- .github/workflows/cd-api-infra.yml | 67 ----------------------- .github/workflows/cd-api.yml | 40 -------------- .github/workflows/cd-frontend-infra.yml | 67 ----------------------- .github/workflows/cd-frontend.yml | 39 -------------- 6 files changed, 322 deletions(-) delete mode 100644 .github/workflows/cd-analytics-infra.yml delete mode 100644 .github/workflows/cd-analytics.yml delete mode 100644 .github/workflows/cd-api-infra.yml delete mode 100644 .github/workflows/cd-api.yml delete mode 100644 .github/workflows/cd-frontend-infra.yml delete mode 100644 .github/workflows/cd-frontend.yml diff --git a/.github/workflows/cd-analytics-infra.yml b/.github/workflows/cd-analytics-infra.yml deleted file mode 100644 index 3bdf1203d..000000000 --- a/.github/workflows/cd-analytics-infra.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Deploy Analytics Infra - -run-name: Deploy ${{ github.ref_name }} to Analytics ${{ (github.event_name == 'release' && 'prod') || 'nonprod' }} - -on: - push: - branches: - - main - paths: - - "infra/analytics/**" - release: - types: [published] - -jobs: - build-repository: - name: Build Repository - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: analytics - environment: shared - - - name: Build Repository - run: | - ./bin/terraform-init-and-apply.sh infra/analytics/build-repository shared - - deploy-infra: - name: Deploy Infrastructure - runs-on: ubuntu-latest - strategy: - matrix: - directory: ["database", "service"] - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || fromJSON('["dev", "staging"]') }} # deploy prod on releases, otherwise deploy staging and dev - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: analytics - environment: shared - - - name: Terraform Init and Apply - run: | - ./bin/terraform-init.sh infra/analytics/${{ matrix.directory }} ${{ matrix.envs }} - export TF_CLI_ARGS="-input=false -auto-approve -var environment_name=${{ matrix.envs }}" - ./bin/terraform-apply.sh infra/analytics/${{ matrix.directory }} ${{ matrix.envs }} diff --git a/.github/workflows/cd-analytics.yml b/.github/workflows/cd-analytics.yml deleted file mode 100644 index 4f385a7df..000000000 --- a/.github/workflows/cd-analytics.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy Analytics -# Need to set a default value for when the workflow is triggered from a git push -# which bypasses the default configuration for inputs -run-name: Deploy ${{ github.ref_name }} to Analytics ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod'}} # changed for consistency with other files - -on: - push: - branches: - - "main" - paths: - - "analytics/**" - release: - types: [published] - workflow_dispatch: - inputs: - environment: - description: "target environment" - required: true - default: "dev" - type: choice - options: - - dev - - staging - - prod - -jobs: - analytics-checks: - name: Run Analyics Checks - uses: ./.github/workflows/ci-analytics.yml - secrets: inherit - - deploy: - name: Deploy - needs: analytics-checks - uses: ./.github/workflows/deploy.yml - strategy: - matrix: - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev", "staging"]') || fromJSON('["dev"]') }} - with: - app_name: "analytics" - environment: ${{ matrix.envs }} diff --git a/.github/workflows/cd-api-infra.yml b/.github/workflows/cd-api-infra.yml deleted file mode 100644 index afaa15d36..000000000 --- a/.github/workflows/cd-api-infra.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Deploy API Infra - -run-name: Deploy ${{ github.ref_name }} to API ${{ (github.event_name == 'release' && 'prod') || 'nonprod' }} - -on: - push: - branches: - - main - paths: - - "infra/api/**" - release: - types: [published] - -jobs: - build-repository: - name: Build Repository - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: api - environment: shared - - name: Build Repository - run: | - ./bin/terraform-init-and-apply.sh infra/api/build-repository shared - - deploy-infra: - name: Deploy Infrastructure - runs-on: ubuntu-latest - strategy: - matrix: - directory: ["database", "service"] - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || fromJSON('["dev", "staging"]') }} # deploy prod on releases, otherwise deploy staging and dev - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: api - environment: shared - - - name: Terraform Init and Apply - run: | - ./bin/terraform-init.sh infra/api/${{ matrix.directory }} ${{ matrix.envs }} - export TF_CLI_ARGS="-input=false -auto-approve -var environment_name=${{ matrix.envs }}" - ./bin/terraform-apply.sh infra/api/${{ matrix.directory }} ${{ matrix.envs }} diff --git a/.github/workflows/cd-api.yml b/.github/workflows/cd-api.yml deleted file mode 100644 index 91a67926c..000000000 --- a/.github/workflows/cd-api.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Deploy API -# Need to set a default value for when the workflow is triggered from a git push -# which bypasses the default configuration for inputs -run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }} - -on: - push: - branches: - - "main" - paths: - - "api/**" - release: - types: [published] - workflow_dispatch: - inputs: - environment: - description: "target environment" - required: true - default: "dev" - type: choice - options: - - dev - - staging - - prod - -jobs: - api-checks: - name: Run API Checks - uses: ./.github/workflows/ci-api.yml - - deploy: - name: Deploy - needs: api-checks - uses: ./.github/workflows/deploy.yml - strategy: - matrix: - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev", "staging"]') || fromJSON('["dev"]') }} - with: - app_name: "api" - environment: ${{ matrix.envs }} diff --git a/.github/workflows/cd-frontend-infra.yml b/.github/workflows/cd-frontend-infra.yml deleted file mode 100644 index 8d10624a2..000000000 --- a/.github/workflows/cd-frontend-infra.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Deploy Frontend Infra - -run-name: Deploy ${{ github.ref_name }} to Frontend ${{ (github.event_name == 'release' && 'prod') || 'nonprod' }} - -on: - push: - branches: - - main - paths: - - "infra/frontend/**" - release: - types: [published] - -jobs: - build-repository: - name: Build Repository - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: analytics - environment: shared - - name: Build Repository - run: | - ./bin/terraform-init-and-apply.sh infra/frontend/build-repository shared - - deploy-infra: - name: Deploy Infrastructure - runs-on: ubuntu-latest - strategy: - matrix: - directory: ["service"] - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || fromJSON('["dev", "staging"]') }} # deploy prod on releases, otherwise deploy staging and dev - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v3 - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.8.2 - terraform_wrapper: false - - - name: Configure AWS credentials - uses: ./.github/actions/configure-aws-credentials - with: - app_name: frontend - environment: shared - - - name: Terraform Init and Apply - run: | - ./bin/terraform-init.sh infra/frontend/${{ matrix.directory }} ${{ matrix.envs }} - export TF_CLI_ARGS="-input=false -auto-approve -var environment_name=${{ matrix.envs }}" - ./bin/terraform-apply.sh infra/frontend/${{ matrix.directory }} ${{ matrix.envs }} diff --git a/.github/workflows/cd-frontend.yml b/.github/workflows/cd-frontend.yml deleted file mode 100644 index aac58f53d..000000000 --- a/.github/workflows/cd-frontend.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Deploy Frontend -# Need to set a default value for when the workflow is triggered from a git push -# which bypasses the default configuration for inputs -run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }} -on: - push: - branches: - - main - paths: - - "frontend/**" - release: - types: [published] - workflow_dispatch: - inputs: - environment: - description: "target environment" - required: true - default: "dev" - type: choice - options: - - dev - - staging - - prod - -jobs: - frontend-checks: - name: Run Frontend Checks - uses: ./.github/workflows/ci-frontend.yml - - deploy: - name: Deploy - needs: frontend-checks - uses: ./.github/workflows/deploy.yml - strategy: - matrix: - envs: ${{ github.event_name == 'release' && fromJSON('["prod"]') || github.ref_name == 'main' && fromJSON('["dev"]') || fromJSON('["dev"]') }} # temporarily removing staging from matrix. See: https://github.com/HHS/simpler-grants-gov/issues/1919 - with: - app_name: "frontend" - environment: ${{ matrix.envs }}