generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 14
46 lines (46 loc) · 1.48 KB
/
terraform-plan-with-oidc.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
42
43
44
45
46
name: Terraform deploy with OIDC
on:
workflow_dispatch:
inputs:
target-host-environment:
type: choice
description: The AWS environment to deploy (dev/test/prod)
options:
- dev
- test
- prod
permissions:
id-token: write
contents: read
jobs:
TerraformPlan:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::035866691871:role/gha-incubator
role-session-name: ghaincubatorsession
aws-region: us-west-2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Generate and apply plan
run: |
pushd ./terraform-incubator/home-unite-us/dev
terraform init
terraform import aws_route53_zone.original 'Z03829196Z0VAL9Q8CZ'
terraform plan -out tf.plan
terraform apply tf.plan
popd
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
# with:
# registries: "035866691871"
# - name: Push an example image
# run: |
# docker pull nginx:alpine
# docker tag nginx:alpine '035866691871.dkr.ecr.us-west-2.amazonaws.com/homeuniteus:nginx-20241002.1'
# docker push '035866691871.dkr.ecr.us-west-2.amazonaws.com/homeuniteus:nginx-20241002.1'