Skip to content

Commit d2f413d

Browse files
eljoates-madetechmaysakanonimattbee
committed
move production deployment to separte workflow that's triggered by release
Co-authored-by: joates-madetech <james.oates@madetech.com> Co-authored-by: maysakanoni <maysa@madetech.com> Co-authored-by: mattbee <matt.bee@madetech.com>
1 parent 89577c8 commit d2f413d

File tree

3 files changed

+67
-110
lines changed

3 files changed

+67
-110
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Data-Platform (Production)
2+
env:
3+
aws_deploy_account: ${{ secrets.AWS_ACCOUNT_DATA_PLATFORM_STG }}
4+
aws_api_account: ${{ secrets.AWS_API_ACCOUNT_STG }}
5+
aws_deploy_region: "eu-west-2"
6+
environment: "stg"
7+
terraform_state_s3_key_prefix: "data-platform"
8+
build_path: "."
9+
automation_build_url: "https://github.com/LBHackney-IT/data-platform/actions/workflows/data_platform_prod.yml"
10+
on:
11+
release:
12+
types: [published]
13+
paths-ignore:
14+
- "documentation/**"
15+
- "infrastructure/projects/**"
16+
- "infrastructure/platform/**"
17+
workflow_dispatch:
18+
inputs:
19+
terraform_import:
20+
description: "Terraform import statements"
21+
required: false
22+
terraform_remove:
23+
description: "Terraform state rm statements"
24+
required: false
25+
26+
jobs:
27+
build:
28+
name: AWS Terraform
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Source
32+
uses: actions/checkout@v2
33+
- name: Set Node.js 14
34+
uses: actions/setup-node@v2
35+
with:
36+
node-version: "14"
37+
- name: Install dependencies in rds-database-snapshot-replicator lambda
38+
working-directory: "./lambdas/rds-database-snapshot-replicator/lambda"
39+
run: npm install
40+
- name: Set up Google Cloud Credentials
41+
run: |
42+
echo $GOOGLE_CREDENTIALS_STG >> ./google_service_account_creds.json
43+
shell: bash
44+
env:
45+
GOOGLE_CREDENTIALS_STG: ${{secrets.GOOGLE_CREDENTIALS_STG}}
46+
- name: Run AWS Terraform
47+
uses: ./.github/actions/aws-terraform
48+
with:
49+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
50+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
51+
aws_deploy_region: ${{ env.aws_deploy_region }}
52+
terraform_state_s3_key_prefix: ${{ env.terraform_state_s3_key_prefix }}
53+
build_path: ${{ env.build_path }}
54+
environment: ${{ env.environment }}
55+
automation_build_url: ${{ env.automation_build_url }}
56+
aws_deploy_account: ${{ env.aws_deploy_account }}
57+
aws_api_account: ${{ env.aws_api_account }}
58+
aws_deploy_iam_role_name: ${{ secrets.AWS_ROLE_TO_ASSUME }}
59+
branch: ${GITHUB_REF##*/}
60+
terraform_import: ${{ github.event.inputs.terraform_import }}
61+
terraform_remove: ${{ github.event.inputs.terraform_remove }}
62+
# DANGER ZONE
63+
# In order to allow you to run a Terraform destroy (that will delete all AWS resources managed by Terraform,
64+
# you can set terraform_destroy: 'destroy_me'. Not providing a value or any other value except 'destroy_me' will
65+
# cause nothing to happen. The example here, with the value set to false is to ensure you've read this comment ;)
66+
terraform_destroy: false

.github/workflows/data_platform_stg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
on:
1919
# This controls when a build will be triggered for a push. Unless you have a specific use case, this should be sufficient!
2020
push:
21-
branches: [mainy]
21+
branches: [main]
2222
paths-ignore:
2323
- "documentation/**"
2424
- "infrastructure/projects/**"

.github/workflows/deploy.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)