-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 1.68 KB
/
workflow.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Main
on:
push:
branches: [ main ]
pull_request: { }
jobs:
required-meta:
uses: BlindfoldedSurgery/actions-meta/.github/workflows/required.yml@v1
fmt:
strategy:
matrix:
directory: [ ".", "modules/pubsub_channel" ]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: terraform fmt -check
working-directory: ${{ matrix.directory }}
validate:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: terraform init -backend=false
- run: terraform validate
env:
GITHUB_APP_PEM_FILE: ${{ secrets.GH_APP_PEM_FILE }}
plan:
runs-on: ubuntu-24.04
needs:
- fmt
- validate
- required-meta
concurrency: production
if: github.event_name == 'pull_request'
env:
DOPPLER_TOKEN: ${{ secrets.TERRAFORM_DOPPLER_TOKEN }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_SA_JSON }}
GITHUB_APP_PEM_FILE: ${{ secrets.GH_APP_PEM_FILE }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: terraform init
- run: terraform plan
apply:
runs-on: ubuntu-24.04
needs:
- fmt
- validate
- required-meta
concurrency: production
if: github.ref_name == github.event.repository.default_branch
env:
DOPPLER_TOKEN: ${{ secrets.TERRAFORM_DOPPLER_TOKEN }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_SA_JSON }}
GITHUB_APP_PEM_FILE: ${{ secrets.GH_APP_PEM_FILE }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: terraform init
- run: terraform apply -auto-approve