-
Notifications
You must be signed in to change notification settings - Fork 421
79 lines (74 loc) · 2.15 KB
/
publish_layer.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Deploy layer to all regions
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
inputs:
latest_published_version:
description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0"
default: "v1.22.0"
required: true
workflow_run:
workflows: ["Publish to PyPi"]
types:
- completed
jobs:
build-layer:
runs-on: ubuntu-latest
if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }}
defaults:
run:
working-directory: ./layer
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.12"
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: Set release notes tag
run: |
RELEASE_INPUT=${{ inputs.latest_published_version }}
LATEST_TAG=$(git describe --tag --abbrev=0)
RELEASE_TAG_VERSION=${RELEASE_INPUT:-$LATEST_TAG}
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
- name: install cdk and deps
run: |
npm install -g [email protected]
cdk --version
- name: install deps
run: |
pip install -r requirements.txt
- name: CDK build
run: cdk synth --context version=$RELEASE_TAG_VERSION -o cdk.out
- name: zip output
run: zip -r cdk.out.zip cdk.out
- name: Archive CDK artifacts
uses: actions/upload-artifact@v3
with:
name: cdk-layer-artefact
path: layer/cdk.out.zip
deploy-beta:
needs:
- build-layer
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
with:
stage: "BETA"
artefact-name: "cdk-layer-artefact"
environment: "layer-beta"
deploy-prod:
needs:
- deploy-beta
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
with:
stage: "PROD"
artefact-name: "cdk-layer-artefact"
environment: "layer-prod"