-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (80 loc) · 2.71 KB
/
validate.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: 📝 Validation
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
validate:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
env:
CI: true
STAC_SERVER_TAG: v3.7.0
CIRRUS_TAG: v1.0.0a0
fd-aws-tf-modules-version: v2.29.0
stage: dev
project-name: goose
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.7.5"
- name: Preparing Environment
id: prep_env
run: |
echo "Creating terraform backend file ..."
echo '' > config.s3.backend.tf
echo 'terraform {' >> config.s3.backend.tf
echo ' backend "s3" {' >> config.s3.backend.tf
echo ' encrypt = true' >> config.s3.backend.tf
echo " bucket = \"${{ secrets.TF_STATE_BUCKET }}\"" >> config.s3.backend.tf
echo " dynamodb_table = \"${{ secrets.TF_STATE_LOCK_TABLE }}\"" >> config.s3.backend.tf
echo " key = \"${{ env.project-name }}-${{ env.stage }}.tfstate\"" >> config.s3.backend.tf
echo " region = \"${{ secrets.AWS_REGION }}\"" >> config.s3.backend.tf
echo ' }' >> config.s3.backend.tf
echo '}' >> config.s3.backend.tf
cat config.s3.backend.tf
echo "Using FilmDrop Terraform ${{ env.fd-aws-tf-modules-version }} release..."
./scripts/retrieve_tf_modules.sh ${{ env.fd-aws-tf-modules-version }}
- name: Update stac-server lambdas
id: update_stac_lambdas
run: ./scripts/update-stac-server-lambdas.bash
- name: Update cirrus lambda dist
id: update_cirrus_lambda_dist
run: ./scripts/update-cirrus-lambda-dist.bash
- uses: terraform-linters/setup-tflint@v4
with:
tflint_version: "v0.49.0"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
- name: Configure Terraform Init Credentials
id: init_creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GooseValidate
- name: Terraform Init
id: tf_init
run: terraform init
- name: Terraform Validate
id: tf_validate
run: terraform validate -no-color