You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-25Lines changed: 23 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Terraform and OpenTofu GitHub Actions 
2
2
3
-
This is a suite of terraform and OpenTofu related GitHub Actions that can be used together to build effective Infrastructure as Code workflows.
3
+
This is a suite of Terraform and OpenTofu related GitHub Actions that can be used together to build effective Infrastructure as Code workflows.
4
4
5
5
[GitHub Actions](https://github.com/features/actions) are a way to make automated workflows that trigger when events occur on your GitHub repository, using a YAML file that lives in your repo.
6
6
These actions can be used to easily perform [Terraform](https://www.terraform.io/) or [OpenTofu](https://www.opentofu.org/) tasks as part of your workflow.
@@ -10,27 +10,29 @@ Currently, there is just experimental support for OpenTofu, see [here](https://g
These terraform actions can be added as steps to your own workflow files.
31
+
These actions can be added as steps to your own workflow files.
30
32
GitHub reads workflow files from `.github/workflows/` within your repository.
31
33
See the [Workflow documentation](https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#about-workflows) for details on writing workflows.
32
34
33
-
Here are some examples of how the terraform actions can be used together in workflows.
35
+
Here are some examples of how the actions can be used together in workflows.
34
36
35
37
### Terraform plan PR approval
36
38
@@ -48,7 +50,7 @@ You can make GitHub enforce this using branch protection, see the [dflook/terraf
48
50
In this example we use two workflows:
49
51
50
52
#### plan.yaml
51
-
This workflow runs on changes to a PR branch. It generates a terraform plan and attaches it to the PR as a comment.
53
+
This workflow runs on changes to a PR branch. It generates a Terraform plan and attaches it to the PR as a comment.
52
54
```yaml
53
55
name: Create terraform plan
54
56
@@ -179,7 +181,7 @@ jobs:
179
181
```
180
182
181
183
### Scheduled infrastructure updates
182
-
There may be times when you expect terraform to plan updates without any changes to your terraform configuration files.
184
+
There may be times when you expect Terraform to plan updates without any changes to your configuration files.
183
185
Your configuration could be consuming secrets from elsewhere, or renewing certificates every few months.
184
186
185
187
This example workflow runs every morning and applies any outstanding changes to those specific resources.
@@ -211,7 +213,7 @@ jobs:
211
213
```
212
214
213
215
### Automatically fixing formatting
214
-
Perhaps you don't want to spend engineer time making formatting changes. This workflow will automatically create or update a PR that fixes any terraform formatting issues.
216
+
Perhaps you don't want to spend engineer time making formatting changes. This workflow will automatically create or update a PR that fixes any formatting issues.
215
217
216
218
#### fmt.yaml
217
219
```yaml
@@ -253,7 +255,7 @@ There are two workflows:
253
255
#### integration-test.yaml
254
256
This workflow runs with every change to a PR.
255
257
256
-
It deploys the testing infrastructure using a terraform workspace dedicated to this branch, then runs integration tests against the new infrastructure.
258
+
It deploys the testing infrastructure using a Terraform workspace dedicated to this branch, then runs integration tests against the new infrastructure.
257
259
258
260
```yaml
259
261
name: Run integration tests
@@ -310,7 +312,3 @@ jobs:
310
312
path: my-terraform-config
311
313
workspace: ${{ github.head_ref }}
312
314
```
313
-
314
-
## What if I don't use GitHub Actions?
315
-
If you use CircleCI, check out OVO Energy's [`ovotech/terraform`](https://github.com/ovotech/circleci-orbs/tree/master/terraform) CircleCI orb.
0 commit comments