-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.46 KB
/
Copy pathmain.yml
File metadata and controls
62 lines (53 loc) · 1.46 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
name: CI-CD
on:
workflow_dispatch:
push:
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core SDKs
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-north-1
role-to-assume: ${{ secrets.DEPLOY_ROLE }}
role-session-name: OIDCSession
- name: Restore
run: dotnet restore --runtime linux-x64
- name: Build
run: dotnet build --no-restore
- name: Publish PostFunction
run: dotnet publish --no-build --configuration Release
- name: Zip Packages
run: |
mkdir .output
projects=(GetFunction PostFunction)
for project in "${projects[@]}"
do
cd src/$project/bin/Release/net8.0/linux-x64/publish
zip -q -D ../../../../../../../.output/$project.zip *
cd ../../../../../../../
done
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup CDK
run: npm install -g aws-cdk
- name: CDK Bootstrap
run: cdk bootstrap
- name: CDK Deploy
run: cdk deploy --require-approval never --all