-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.29 KB
/
infra-tf-backend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Workflow to deploy TF backend to Prod Account.
name: Deploy TF Backend Infrastructure
# Controls when the workflow will run
on:
# Triggers the workflow on push event but only for the "master" branch and when the files inside tf-backend changes
push:
branches: [ "master" ]
paths:
- cloudformation/tf-backend/**
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: prod
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Checkout
uses: actions/checkout@v3
# Configure the AWS Enviromnet Variables insdie the Runner
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
# Deploy the terrafrom backend Cloudformation Stack
- name: Deploy Cloudfromation
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: Terrafrom-Backend
template: cloudformation/tf-backend/tf-backend.yaml
parameter-overrides: "StateBucketName=ayd-poc-tf-state,LockTableName=ayd-poc-tf-lock-table"