-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (55 loc) · 1.49 KB
/
deployment.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
name: "GitHub Runner Deployment"
on:
workflow_dispatch:
inputs:
environment:
description: "Which environment?"
type: choice
# Add new environment context value to the options below.
options:
- "ops-dev"
permissions:
id-token: write
contents: write
jobs:
deploy:
name: Deploy ${{ matrix.environment }}
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
environment: [ "${{ github.event.inputs.environment }}" ]
include:
- environment: ops-dev
assume_role: arn:aws:iam::123456789100:role/githubActionsOidc
region: us-east-1
defaults:
run:
shell: bash
working-directory: cdk
steps:
- name: Checkout
uses: actions/checkout@v3
id: checkout
- name: Set up node
uses: actions/setup-node@v3
id: set-node
with:
node-version: "16"
check-latest: true
- name: Configure credentials
id: aws-creds
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ matrix.assume_role }}
role-duration-seconds: 1200
aws-region: ${{ matrix.region }}
- name: Install dependencies
id: npm-i
run: npm install
- name: Run deployment
id: deploy
run: |
npx cdk deploy "*" -c config=$ENVIRONMENT --require-approval never
env:
ENVIRONMENT: ${{ matrix.environment }}