-
Notifications
You must be signed in to change notification settings - Fork 12
71 lines (61 loc) · 2 KB
/
Copy path_deploy.yml
File metadata and controls
71 lines (61 loc) · 2 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
# Baut Assets und `cdk deploy`t direkt, ohne Bestätigung
# intendiert für dev
name: deploy
on:
workflow_call:
inputs:
stage:
description: CDK-Stage (dev / staging / prod)
required: true
type: string
environment:
description: GitHub-Environment
required: true
type: string
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-26.04 # noch in Test -> latest lieber vermeiden
#runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
# verhindert überlappende Deploys auf dieselbe Stage
concurrency:
group: deploy-${{ inputs.stage }}
cancel-in-progress: false
env:
AWS_REGION: eu-central-1
NODE_OPTIONS: --max-old-space-size=4096
BRANCH: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node 24 einrichten
uses: actions/setup-node@v4
with:
node-version: 24
cache: yarn
- name: AWS-Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_2026 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_2026 }}
aws-region: ${{ env.AWS_REGION }}
- name: Frontend-Dependencies installieren
run: yarn install --frozen-lockfile
- name: Frontend bauen
run: yarn build
env:
NODE_ENV: production
# CDK-Projekt (npm). esbuild für das Lambda-Bundling wird aus dem
# Repo-Root (yarn) aufgelöst und muss dort nicht erneut installiert werden
- name: CDK-Dependencies installieren
run: npm ci
working-directory: cdk
# Loggt das diff -> keine Bestätigung nötig
- name: CDK diff
run: npx cdk diff --context stage=${{ inputs.stage }}
working-directory: cdk
- name: CDK deploy
run: npx cdk deploy --context stage=${{ inputs.stage }} --require-approval never
working-directory: cdk