diff --git a/.github/workflows/continuous-deployment.yml b/.github/workflows/continuous-deployment.yml index aea39e600b..dc58703885 100644 --- a/.github/workflows/continuous-deployment.yml +++ b/.github/workflows/continuous-deployment.yml @@ -1,5 +1,5 @@ name: Continuous deployment -run-name: Continuous deployment of ${{ github.ref }} to "copilotmigration" +run-name: Continuous deployment of ${{ github.ref_name }} to QA and Test on: push: @@ -11,13 +11,13 @@ jobs: build-and-push-image: needs: test uses: ./.github/workflows/build-and-push-image.yml - deploy-infrastructure: - needs: test - uses: ./.github/workflows/deploy-infrastructure.yml - with: - environment: copilotmigration - deploy-application: - needs: [build-and-push-image, deploy-infrastructure] - uses: ./.github/workflows/deploy-application.yml + deploy-mavis: + needs: build-and-push-image + strategy: + fail-fast: false + matrix: + environment: ["qa", "test"] + uses: ./.github/workflows/deploy-mavis.yml with: - environment: copilotmigration + environment: ${{ matrix.environment }} + image_tag: ${{ github.sha }} diff --git a/.github/workflows/deploy-application.yml b/.github/workflows/deploy-application.yml index bb20d88965..e735fcea19 100644 --- a/.github/workflows/deploy-application.yml +++ b/.github/workflows/deploy-application.yml @@ -25,6 +25,9 @@ on: environment: required: true type: string + image_tag: + required: false + type: string env: aws-role: ${{ inputs.environment == 'production' @@ -77,7 +80,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: tfplan_app + name: tfplan_app-${{ inputs.environment }} path: ${{ runner.temp }}/tfplan apply-changes: @@ -98,7 +101,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: tfplan_app + name: tfplan_app-${{ inputs.environment }} path: ${{ runner.temp }} - name: Install terraform uses: hashicorp/setup-terraform@v3 @@ -116,7 +119,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: CODEDEPLOY_ENV + name: CODEDEPLOY_ENV-${{ inputs.environment }} path: ${{ runner.temp }}/CODEDEPLOY_ENV create-deployment: @@ -130,7 +133,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: CODEDEPLOY_ENV + name: CODEDEPLOY_ENV-${{ inputs.environment }} path: ${{ runner.temp }}/artifact - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/deploy-infrastructure.yml b/.github/workflows/deploy-infrastructure.yml index b60584b220..0d58d73754 100644 --- a/.github/workflows/deploy-infrastructure.yml +++ b/.github/workflows/deploy-infrastructure.yml @@ -83,7 +83,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: tfplan_infrastructure + name: tfplan_infrastructure-${{ inputs.environment }} path: ${{ runner.temp }}/tfplan apply: @@ -104,7 +104,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: tfplan_infrastructure + name: tfplan_infrastructure-${{ inputs.environment }} path: ${{ runner.temp }} - name: Install terraform uses: hashicorp/setup-terraform@v3 diff --git a/.github/workflows/deploy-mavis.yml b/.github/workflows/deploy-mavis.yml new file mode 100644 index 0000000000..73341e8c3b --- /dev/null +++ b/.github/workflows/deploy-mavis.yml @@ -0,0 +1,43 @@ +name: Deploy Mavis on Environment +run-name: Deploying Mavis on ${{ inputs.environment }} + +on: + workflow_call: + inputs: + environment: + required: true + type: string + image_tag: + description: Docker image tag of the image to deploy + required: true + type: string + workflow_dispatch: + inputs: + environment: + description: Deployment environment + required: true + type: choice + options: + - qa + - poc + - test + - preview + - training + - production + - copilotmigration + image_tag: + description: Docker image tag of the image to deploy + required: true + type: string + +jobs: + deploy-infrastructure: + uses: ./.github/workflows/deploy-infrastructure.yml + with: + environment: ${{ inputs.environment }} + deploy-application: + needs: deploy-infrastructure + uses: ./.github/workflows/deploy-application.yml + with: + environment: ${{ inputs.environment }} + image_tag: ${{ inputs.image_tag }}