-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.21 KB
/
terraform-plan.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
47
48
name: Terraform Plan
on:
pull_request:
paths:
- 'terraform/**'
- 'terraform/**/*.yaml'
workflow_dispatch:
jobs:
plan:
runs-on: gha-runner-scale-set-kub1k
container:
image: quay.io/m1k_cloud/automation_docker_image:latest
defaults:
run:
shell: bash
permissions:
contents: read
pull-requests: write
name: Create terraform plan
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up ssh key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent)
ssh-add ~/.ssh/id_rsa
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: terraform plan
run: make plan kub1k
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
- name: Post plan as PR comment
if: github.event_name == 'pull_request'
run: make comment-pr kub1k
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}