-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.24 KB
/
environment-main-deploy.yaml
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
41
name: Environment Main - Apply
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
envtest:
name: Environment Main - Apply
runs-on: ubuntu-latest
environment: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08
- name: Configure AWS Access
uses: aws-actions/configure-aws-credentials@39228ca2bffc0bfc8f7761ce893f5b80e7eaaf8f
with:
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT }}:role/GitHubAction-Wildsea@${{ vars.ENVIRONMENT }}
role-session-name: GitHubTest
aws-region: ${{ vars.AWS_REGION }}
- name: terraform plan
uses: dflook/terraform-apply@@c3f4d3e8d5a1a5b8d5e4e3e7f8f2b3a1c4e9d3f2
with:
path: terraform/environment/github
variables: |
aws_account="${{ vars.AWS_ACCOUNT }}"
aws_region="${{ vars.AWS_REGION }}"
state_bucket="${{ vars.STATE_BUCKET }}"
environment="${{ vars.ENVIRONMENT }}"
backend_config:
bucket=${{ vars.STATE_BUCKET }}
key=${{ vars.ENVIRONMENT }}/terraform.tfstate
region=${{ vars.AWS_REGION }}