-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 987 Bytes
/
terraform.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
name: 'Terraform'
on:
push:
branches: [ "main" ]
schedule:
- cron: '3 * * * *'
permissions:
contents: read
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Generate Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app_id: 856597
private_key: ${{ secrets.BRANCH_PROTECTIONS_APP_PRIVATE_KEY }}
owner: DbUp
- name: Checkout
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
working-directory: BranchProtections
run: terraform init
- name: Terraform Apply
working-directory: BranchProtections
run: terraform apply -auto-approve -input=false
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}