From 9bef23402be96bc5d5fd0efc25ea889e999942f8 Mon Sep 17 00:00:00 2001 From: Ross Hamilton Date: Tue, 5 Dec 2023 15:54:41 +0000 Subject: [PATCH] Adding VTM App deployment GHA --- .github/workflows/deploy-VTMDev-1.yml | 15 +++++++ .github/workflows/deploy-devops.yml | 18 +++++++++ .github/workflows/deploy-feature.yml | 6 +-- .github/workflows/deploy.yml | 56 ++++++++++++++------------- 4 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/deploy-VTMDev-1.yml create mode 100644 .github/workflows/deploy-devops.yml diff --git a/.github/workflows/deploy-VTMDev-1.yml b/.github/workflows/deploy-VTMDev-1.yml new file mode 100644 index 0000000000..e0361c953c --- /dev/null +++ b/.github/workflows/deploy-VTMDev-1.yml @@ -0,0 +1,15 @@ +name: Build and Deploy VTM to VTMDev1 +run-name: "${{ github.actor }} - ${{ github.ref_name }} - ${{ github.run_id }} 🚀" + +on: + workflow_dispatch: + +jobs: + feature-build: + uses: ./.github/workflows/deploy.yml + with: + branch: ${{ github.ref_name }} + environment: 'vtmdev-1.develop' + secrets: + AWS_MGMT_ROLE: ${{ secrets.AWS_MGMT_ROLE }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} diff --git a/.github/workflows/deploy-devops.yml b/.github/workflows/deploy-devops.yml new file mode 100644 index 0000000000..b9be31bbda --- /dev/null +++ b/.github/workflows/deploy-devops.yml @@ -0,0 +1,18 @@ +name: Build and Deploy VTM to Devops +run-name: "${{ github.actor }} - ${{ github.ref_name }} - ${{ github.run_id }} 🚀" + +on: + workflow_dispatch: + push: + branches: + - 'feature/CB2-9116' + +jobs: + feature-build: + uses: ./.github/workflows/deploy.yml + with: + branch: ${{ github.ref_name }} + environment: 'devops' + secrets: + AWS_MGMT_ROLE: ${{ secrets.AWS_MGMT_ROLE }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} diff --git a/.github/workflows/deploy-feature.yml b/.github/workflows/deploy-feature.yml index 97e00d37e4..89c3708133 100644 --- a/.github/workflows/deploy-feature.yml +++ b/.github/workflows/deploy-feature.yml @@ -3,9 +3,9 @@ run-name: "${{ github.actor }} - ${{ github.ref_name }} - ${{ github.run_id }} on: workflow_dispatch: - push: - branches: - - 'feature/*' +# push: +# branches: +# - 'feature/*' jobs: feature-build: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b27a1ebaae..d9c9b83a1c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -61,33 +61,34 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} run: npm run build -- --configuration='deploy' --output-path='dist/' - deploy_infra: - needs: [build] - name: "Deploy VTM Terraform" - runs-on: ubuntu-latest - steps: - - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_MGMT_ROLE }} - aws-region: "eu-west-1" - role-session-name: MGMTGHA - - - uses: aws-actions/aws-secretsmanager-get-secrets@v1 - with: - secret-ids: github/cvs-ops - parse-json-secrets: true - - - uses: actions/checkout@v3 - - name: Start Jobs - env: - ACTION: "tf-apply" - BRANCH: ${{ inputs.branch }} - ENVIRONMENT: ${{ inputs.environment }} - ACTIONS_KEY: ${{ env.GITHUB_CVS_OPS_TOKEN }} - run: python .github/scripts/dispatcher.py +# deploy_infra: +# needs: [build] +# name: "Deploy VTM Terraform" +# runs-on: ubuntu-latest +# steps: +# - uses: aws-actions/configure-aws-credentials@v4 +# with: +# role-to-assume: ${{ secrets.AWS_MGMT_ROLE }} +# aws-region: "eu-west-1" +# role-session-name: MGMTGHA +# +# - uses: aws-actions/aws-secretsmanager-get-secrets@v1 +# with: +# secret-ids: github/cvs-ops +# parse-json-secrets: true +# +# - uses: actions/checkout@v3 +# - name: Start Jobs +# env: +# ACTION: "tf-apply" +# BRANCH: ${{ inputs.branch }} +# ENVIRONMENT: ${{ inputs.environment }} +# ACTIONS_KEY: ${{ env.GITHUB_CVS_OPS_TOKEN }} +# run: python .github/scripts/dispatcher.py deploy_app: - needs: [build, deploy_infra] + needs: [build] + environment: ${{ inputs.environment }} runs-on: ubuntu-latest steps: - name: Get AWS Credentials @@ -104,5 +105,8 @@ jobs: - name: Deploy App to S3 working-directory: cvs-app-vtm/dist/ - run: aws s3 sync . s3://vtm-${LBRANCH}.develop.${{ env.CVS_APP_VTM_GHA_DOMAIN }} + run: aws s3 sync . s3://vtm-${{ inputs.environment }}.${{ env.CVS_APP_VTM_GHA_DOMAIN }} + + +