-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (79 loc) · 2.68 KB
/
deploy.yml
File metadata and controls
97 lines (79 loc) · 2.68 KB
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
95
96
97
name: Deploy
on:
workflow_dispatch:
inputs:
environment:
type: environment
description: "Select the environment to deploy to"
jobs:
terraform-check:
runs-on: ubuntu-latest
environment: DryRun
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2
- name: Terraform Plan
id: plan
working-directory: ./infrastructure/terraform
run: terraform plan -no-color -input=false -var-file=environments/${{ github.event.inputs.environment }}.tfvars
deploy-infra:
runs-on: ubuntu-latest
needs: [terraform-check]
environment: ${{ github.event.inputs.environment }}
if: github.event.inputs.environment != 'DryRun'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2
- name: Terraform Init
id: init
working-directory: ./infrastructure/terraform
run: terraform init -no-color -input=false -backend-config=backend.tfvars
- name: Terraform Apply
id: apply
working-directory: ./infrastructure/terraform
run: terraform apply -auto-approve -input=false -var-file=environments/${{ github.event.inputs.environment }}.tfvars
deploy-lambda:
runs-on: ubuntu-latest
needs: [deploy-infra]
environment: ${{ github.event.inputs.environment }}
if: github.event.inputs.environment != 'DryRun' && github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.1.0
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-east-1
- name: Terraform Init
id: init
working-directory: ./infrastructure
run: terraform init -no-color -input=false -backend-config=backend.tfvars
- name: Build
run: make publish
- name: Deploy
run: ./ci/deploy_lambda.sh