-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.94 KB
/
go-cdk-deploy-client-gateway.yaml
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
on:
workflow_call:
inputs:
env:
required: true
type: string
account-id:
required: true
type: string
jobs:
aws_cdk:
runs-on: ubuntu-latest
container:
image: ghcr.io/useheartbeat/heartbeat-go-cdk-dockerfile:main
credentials:
username: hbh-github
password: ${{ secrets.GH_TOKEN }}
permissions:
id-token: write
contents: read
name: Deploy
steps:
- name: Checkout repo
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get modules
working-directory: ./cdk-infra
run: |
go mod download
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ inputs.account-id }}:role/GitHubRole
role-session-name: actions-${{ inputs.env }}
aws-region: 'us-east-1'
- name: Clear context
working-directory: ./cdk-infra
run: cdk context --clear
- name: Deploy GW stack
id: cdk-deploy
working-directory: ./cdk-infra
run: cdk deploy --require-approval never -c envName=${{ inputs.env }} HBHClientImportVpcStack HBHClientApiGwStack
- name: Post failed status
if: ${{ always() && steps.cdk-deploy.outcome != 'success' && github.actor != 'renovate[bot]'}}
uses: act10ns/[email protected]
with:
status: ${{ steps.cdk-deploy.outcome }}
channel: '#alerts-severe'
message: Build ${{ steps.cdk-deploy.outcome }}, logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SEVERE }}