-
Notifications
You must be signed in to change notification settings - Fork 7
84 lines (82 loc) · 3.09 KB
/
code.deploy.development.yml
File metadata and controls
84 lines (82 loc) · 3.09 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
74
75
76
77
78
79
80
81
82
83
84
name: Deploy Development Environment
on:
push:
branches: [ "main", "develop", "release/**" ]
permissions:
id-token: write
contents: read
jobs:
CheckPendingWorkflow:
runs-on: ubuntu-latest
steps:
- uses: ahmadnassri/action-workflow-queue@v1
with:
delay: 300000
timeout: 7200000
DeployMLSpace:
needs: CheckPendingWorkflow
environment: development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT }}:role/${{ vars.ROLE_NAME_TO_ASSUME }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
role-duration-seconds: 7200
- name: Create config.json
id: create-json
uses: jsdaniell/create-json@v1.2.3
with:
name: "config.json"
json: |
{
"AWS_ACCOUNT": "${{ vars.AWS_ACCOUNT }}",
"AWS_REGION": "${{ vars.AWS_REGION }}",
"AUTH_OIDC_CLIENT_ID": "${{ vars.AUTH_OIDC_CLIENT_ID }}",
"AUTH_OIDC_URL": "${{ vars.AUTH_OIDC_URL }}",
"KEY_MANAGER_ROLE_NAME": "${{ vars.KEY_MANAGER_ROLE_NAME }}"
}
dir: './lib/'
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install frontend dependencies
working-directory: ./frontend
run: |
npm install
- name: Build frontend
working-directory: ./frontend
run: |
npm run build
- name: Install CDK dependencies
run: |
npm install
- name: Deploy CDK
run: |
npm install -g aws-cdk
cdk deploy --require-approval never --all
SendSlackNotification:
name: Send Slack Notification
needs: [ DeployMLSpace ]
runs-on: ubuntu-latest
if: always()
steps:
- name: Send Notification that Dev Deploy Finished
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
SLACK_TITLE: 'Dev Deploy Finished'
SLACK_FOOTER: ''
MSG_MINIMAL: 'actions url,commit'
SLACK_MESSAGE_ON_FAILURE: '<!here> Dev Deploy FAILED on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>'
SLACK_MESSAGE_ON_SUCCESS: 'Dev Deploy SUCCESS on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>.'
SLACK_MESSAGE: 'Dev Deploy Finished with status ${{ job.status }} on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>'