-
Notifications
You must be signed in to change notification settings - Fork 33
68 lines (61 loc) · 2.04 KB
/
ci-ops-infra.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
name: "CI - Update OPS Infrastructure"
on:
push:
branches:
- master
paths:
- '.github/workflows/ci-ops-infra.yml'
- '.github/actions/deploy-terraservice/**'
- 'ops/terraform/env/mgmt/**'
workflow_dispatch:
permissions:
id-token: write # This is required for requesting the AWS IAM OIDC JWT
contents: write # This is required for actions/checkout
defaults:
run:
shell: bash
env:
DEFAULT_LOG_GROUP: "/bfd/mgmt/gha/ci-ops-infra"
DEFAULT_LOG_STREAM: "deploy-terraservice_${{ github.run_number }}"
jobs:
update-mgmt-infra:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Configure AWS credentials
id: config-aws-creds
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.GHA_AWS_IAM_ROLE_ARN }}
role-session-name: ci-deploy-mgmt
aws-region: us-east-1
- name: Mask sensitive AWS data
id: mask-sensitive-aws-data
run: |
caller_id="$(aws sts get-caller-identity)"
account_num="$(jq -r '.Account' <<<${caller_id})"
role_arn="$(jq -r '.Arn' <<<${caller_id})"
user_id="$(jq -r '.UserId' <<<${caller_id})"
echo "::add-mask::$account_num"
echo "::add-mask::$role_arn"
echo "::add-mask::$user_id"
- name: Deploy mgmt base_config
id: ci-deploy-mgmt-base-config
uses: ./.github/actions/deploy-terraservice
with:
bfd-env: default
service-path: ops/terraform/env/mgmt/base_config
cw-log-group: ${{ env.DEFAULT_LOG_GROUP }}
cw-log-stream: ${{ env.DEFAULT_LOG_STREAM }}
- name: Deploy mgmt
id: ci-deploy-mgmt
uses: ./.github/actions/deploy-terraservice
with:
bfd-env: default
service-path: ops/terraform/env/mgmt
cw-log-group: ${{ env.DEFAULT_LOG_GROUP }}
cw-log-stream: ${{ env.DEFAULT_LOG_STREAM }}