-
Notifications
You must be signed in to change notification settings - Fork 272
73 lines (63 loc) · 1.84 KB
/
deploy-infra.yml
File metadata and controls
73 lines (63 loc) · 1.84 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
name: Deploy Infra
on:
workflow_dispatch:
inputs:
commit_sha:
description: "Specific commit SHA to checkout"
required: true
type: string
tracking_id:
description: "Unique tracking ID used for identifying the workflow run"
required: false
type: string
environment:
description: "Target environment for deployment, e.g. staging"
required: true
type: string
plan_only:
description: "Only plan the infrastructure changes without applying them"
required: false
type: string
default: "false"
concurrency:
group: deploy-${{ inputs.environment }}
cancel-in-progress: false
jobs:
deploy:
name: Deploy Infra to the ${{ inputs.environment }} environment
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ inputs.commit_sha }}
- name: Setup environment
uses: ./.github/actions/deploy-setup
with:
environment: ${{ inputs.environment }}
install_gcloud: "true"
infisical_machine_identity_id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }}
- name: Run Terraform state migrations
if: inputs.plan_only == 'false'
run: |
make state-migrate || true
- name: Apply init module
if: inputs.plan_only == 'false'
run: |
make apply-init
- name: Copy public builds
run: |
make copy-public-builds
- name: Plan infrastructure
run: |
make plan-without-jobs
- name: Apply infrastructure
if: inputs.plan_only == 'false'
env:
AUTO_CONFIRM_DEPLOY: true
run: |
make apply