-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (50 loc) · 1.62 KB
/
deploy.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
name: Chained Deploy
run-name: Chained Deploy Layer for ${{ github.ref_name }} to ${{ inputs.app_name }} ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }}
on:
workflow_call:
inputs:
app_name:
description: "name of application folder under infra directory"
required: true
type: string
environment:
description: "the name of the application environment (e.g. dev, staging, prod)"
required: true
type: string
concurrency: cd-${{inputs.app_name}}-${{ inputs.environment }}
jobs:
build-and-publish:
name: Build
uses: ./.github/workflows/build-and-publish.yml
with:
app_name: ${{ inputs.app_name }}
ref: ${{ github.ref }}
database-migrations:
name: Database migrations
uses: ./.github/workflows/database-migrations.yml
needs: [build-and-publish]
with:
app_name: ${{ inputs.app_name }}
environment: ${{ inputs.environment }}
deploy:
name: Deploy
runs-on: ubuntu-22.04
needs: [database-migrations]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.7
terraform_wrapper: false
- name: Configure AWS credentials
uses: ./.github/actions/configure-aws-credentials
with:
app_name: ${{ inputs.app_name }}
environment: ${{ inputs.environment }}
- name: Deploy release
run: make release-deploy \
APP_NAME=${{ inputs.app_name }} \
ENVIRONMENT=${{ inputs.environment }}