1
- # Some of this logic was stolen from https://www.freecodecamp.org/news/a-lightweight-tool-agnostic-ci-cd-flow-with-github-actions/
2
-
3
1
name : terraform
4
2
5
3
on :
6
4
push :
7
- # branches:
8
- # - master
9
5
pull_request :
10
6
11
7
jobs :
@@ -14,69 +10,13 @@ jobs:
14
10
runs-on : ubuntu-latest
15
11
steps :
16
12
- name : checkout
17
- uses : actions/checkout@v2
13
+ uses : actions/checkout@v4
18
14
with :
19
15
fetch-depth : 1
20
16
21
17
- name : terraform setup
22
- uses : hashicorp/setup-terraform@v1
23
- with :
24
- terraform_version : 0.12.29
25
- # cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
26
-
27
- # TODO: This step duplicates work done by the Makefile.
28
- # - name: check terraform formatting
29
- # id: fmt
30
- # run: |
31
- # terraform fmt -check -recursive
18
+ uses : hashicorp/setup-terraform@v3
32
19
33
20
- name : run make
34
- # env:
35
- # TOKEN: ${{ secrets.TOKEN }}
36
21
run : |
37
22
make all
38
-
39
- # - name: terraform init
40
- # id: init
41
- # run: terraform init
42
- #
43
- # - name: terraform plan
44
- # id: plan
45
- # if: github.event_name == 'pull_request'
46
- # run: terraform plan -no-color
47
- # continue-on-error: true
48
- #
49
- # - uses: actions/github-script@0.9.0
50
- # if: github.event_name == 'pull_request'
51
- # env:
52
- # PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
53
- # with:
54
- # github-token: ${{ secrets.GITHUB_TOKEN }}
55
- # script: |
56
- # const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
57
- # #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
58
- # #### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
59
- #
60
- # <details><summary>Show Plan</summary>
61
- #
62
- # \`\`\`${process.env.PLAN}\`\`\`
63
- #
64
- # </details>
65
- #
66
- # *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
67
- #
68
- #
69
- # github.issues.createComment({
70
- # issue_number: context.issue.number,
71
- # owner: context.repo.owner,
72
- # repo: context.repo.repo,
73
- # body: output
74
- # })
75
- #
76
- # - name: terraform plan status
77
- # if: steps.plan.outcome == 'failure'
78
- # run: exit 1
79
- #
80
- # - name: terraform apply
81
- # if: github.ref == 'refs/heads/master' && github.event_name == 'push'
82
- # run: terraform apply -auto-approve
0 commit comments