-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (57 loc) · 1.78 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
58
59
60
61
62
63
64
65
66
67
name: deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Select the deployment environment'
required: true
type: choice
options:
- production
- staging
VERSION_TAG:
description: 'Specify the version tag for deployment'
required: true
type: string
workflow_call:
inputs:
environment:
description: 'Select the deployment environment'
required: true
type: string
VERSION_TAG:
description: 'Specify the version tag for deployment'
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
env:
VERSION_TAG: ${{ inputs.VERSION_TAG }}
TERRATEAM_ENVIRONMENT: ${{ inputs.environment }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
MATRIX_PASSWORD: ${{ secrets.MATRIX_PASSWORD }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Flyctl
if: ${{ inputs.environment == 'production' }}
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Configure AWS Credentials with OIDC
if: ${{ inputs.environment == 'staging' }}
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_NUMBER }}:role/terrateam
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Deploy to ECS
if: ${{ inputs.environment == 'staging' }}
run: ./scripts/deploy_ecs
- name: Deploy to Fly.io
if: ${{ inputs.environment == 'production' }}
run: ./scripts/deploy_flyio
- name: Notify Matrix
run: ./scripts/notify_matrix