-
Notifications
You must be signed in to change notification settings - Fork 56
72 lines (68 loc) · 1.74 KB
/
ci.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on:
pull_request:
branches:
- main
paths-ignore:
- .editorconfig
- .gitignore
- CHANGELOG.md
- LICENSE.md
- README.md
push:
branches:
- main
paths-ignore:
- .editorconfig
- .gitignore
- CHANGELOG.md
- LICENSE.md
- README.md
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform_version }}
- name: Initialise with no backend
run: terraform init -backend=false
- name: Check formatting
run: terraform fmt -check -recursive
- name: Validate the configuration
run: terraform validate
strategy:
matrix:
terraform_version: [ "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6" ]
caller-identity:
if: ${{ github.event_name == 'push' }}
name: Return the IAM user
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github
- run: aws sts get-caller-identity
release:
name: Release?
needs: [ caller-identity ]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Prepare a release
uses: google-github-actions/release-please-action@v4
with:
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
token: ${{ secrets.GITHUB_TOKEN }}