Skip to content

Commit

Permalink
Adding VTM App deployment GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
hamiltonrossbjss committed Dec 5, 2023
1 parent 1d8f2c6 commit 9bef234
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 29 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy-VTMDev-1.yml
Original file line number Diff line number Diff line change
@@ -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 }}
18 changes: 18 additions & 0 deletions .github/workflows/deploy-devops.yml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 3 additions & 3 deletions .github/workflows/deploy-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}




0 comments on commit 9bef234

Please sign in to comment.