-
Notifications
You must be signed in to change notification settings - Fork 32
70 lines (68 loc) · 2.55 KB
/
aws-scipool.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
68
69
70
# reusable template for running Sceptre deployments to AWS accounts
# Deploy resources to service catalog prod environments
name: aws-scipool
on:
workflow_call:
inputs:
aws-region:
type: string
default: us-east-1
role-to-assume:
required: true
type: string
role-session-name:
required: true
type: string
role-duration-seconds:
type: number
default: 1200
working-dir:
required: true
type: string
sceptre-command:
type: string
default: "sceptre launch prod --prune --yes"
jobs:
deploy:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Cache python modules
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sceptre sceptre-json-resolver sceptre-request-resolver sceptre-ssm-resolver
- name: Assume AWS Role
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: ${{ inputs.aws-region }}
role-to-assume: ${{ inputs.role-to-assume }}
role-session-name: ${{ inputs.role-session-name }}
role-duration-seconds: ${{ inputs.role-duration-seconds }}
- name: Deploy with sceptre
# SC-26 & SC-219 workaround: dis-associate and re-associate SC actions on every deploy
run: |
cd ${{ inputs.working-dir }}
sceptre delete --yes prod/sc-product-assoc-ec2-linux-docker.yaml
sceptre delete --yes prod/sc-product-assoc-ec2-linux-docker-notebook.yaml
sceptre delete --yes prod/sc-product-assoc-ec2-linux-windows-jumpcloud.yaml
sceptre delete --yes bmgfki/sc-product-assoc-ec2-linux-docker.yaml
sceptre delete --yes bmgfki/sc-product-assoc-ec2-linux-docker-notebook.yaml
sceptre delete --yes bmgfki/sc-product-assoc-ec2-linux-windows-jumpcloud.yaml
sceptre delete --yes strides/sc-product-assoc-ec2-linux-docker.yaml
sceptre delete --yes strides/sc-product-assoc-ec2-linux-docker-notebook.yaml
sceptre delete --yes strides/sc-product-assoc-ec2-linux-windows-jumpcloud.yaml
${{ inputs.sceptre-command }}