-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.19 KB
/
terraform-apply.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
41
42
43
44
45
46
47
48
49
50
51
52
name: Terraform Apply
on:
workflow_call:
inputs:
working-directory:
type: string
required: false
default: tf
apply-command:
type: string
required: false
default: |
terraform init
terraform apply -auto-approve
secrets:
aws-id:
required: true
aws-secret:
required: true
git-read-key:
required: true
jobs:
apply:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.aws-id }}
aws-secret-access-key: ${{ secrets.aws-secret }}
aws-region: eu-central-1
- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.git-read-key }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Terraform Init & Apply
run: |
aws s3 ls
aws sts get-caller-identity
${{ inputs.apply-command }}
working-directory: ${{ inputs.working-directory }}