Skip to content

Commit 2d73675

Browse files
Enabling SAR deployment
1 parent f841519 commit 2d73675

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

.github/workflows/publish_v3_layer.yml

+30-32
Original file line numberDiff line numberDiff line change
@@ -195,41 +195,39 @@ jobs:
195195
source_code_artifact_name: ${{ inputs.source_code_artifact_name }}
196196
source_code_integrity_hash: ${{ inputs.source_code_integrity_hash }}
197197

198-
# UNCOMMENT sar-beta JOB
199-
#sar-beta:
200-
# needs: beta # canaries run on Layer Beta env
201-
# permissions:
198+
sar-beta:
199+
needs: beta # canaries run on Layer Beta env
200+
permissions:
202201
# lower privilege propagated from parent workflow (release.yml)
203-
# id-token: write
204-
# contents: read
205-
# pull-requests: none
206-
# pages: none
207-
# uses: ./.github/workflows/reusable_deploy_v3_sar.yml
208-
# secrets: inherit
209-
# with:
210-
# stage: "BETA"
211-
# environment: "layer-beta"
212-
# package-version: ${{ inputs.latest_published_version }}
213-
# source_code_artifact_name: ${{ inputs.source_code_artifact_name }}
214-
# source_code_integrity_hash: ${{ inputs.source_code_integrity_hash }}
202+
id-token: write
203+
contents: read
204+
pull-requests: none
205+
pages: none
206+
uses: ./.github/workflows/reusable_deploy_v3_sar.yml
207+
secrets: inherit
208+
with:
209+
stage: "BETA"
210+
environment: "layer-beta"
211+
package-version: ${{ inputs.latest_published_version }}
212+
source_code_artifact_name: ${{ inputs.source_code_artifact_name }}
213+
source_code_integrity_hash: ${{ inputs.source_code_integrity_hash }}
215214

216-
# UNCOMMENT sar-prod JOB
217-
#sar-prod:
218-
# needs: sar-beta
219-
# permissions:
215+
sar-prod:
216+
needs: sar-beta
217+
permissions:
220218
# lower privilege propagated from parent workflow (release.yml)
221-
# id-token: write
222-
# contents: read
223-
# pull-requests: none
224-
# pages: none
225-
# uses: ./.github/workflows/reusable_deploy_v3_sar.yml
226-
# secrets: inherit
227-
# with:
228-
# stage: "PROD"
229-
# environment: "layer-prod"
230-
# package-version: ${{ inputs.latest_published_version }}
231-
# source_code_artifact_name: ${{ inputs.source_code_artifact_name }}
232-
# source_code_integrity_hash: ${{ inputs.source_code_integrity_hash }}
219+
id-token: write
220+
contents: read
221+
pull-requests: none
222+
pages: none
223+
uses: ./.github/workflows/reusable_deploy_v3_sar.yml
224+
secrets: inherit
225+
with:
226+
stage: "PROD"
227+
environment: "layer-prod"
228+
package-version: ${{ inputs.latest_published_version }}
229+
source_code_artifact_name: ${{ inputs.source_code_artifact_name }}
230+
source_code_integrity_hash: ${{ inputs.source_code_integrity_hash }}
233231

234232

235233
# Updating the documentation with the latest Layer ARNs is a two-phase process

.github/workflows/reusable_deploy_v3_sar.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ jobs:
135135
env:
136136
VERSION: ${{ inputs.package-version }}
137137
run: |
138-
# VERSION="${VERSION/a/-a}"
139-
VERSION="3.0.0"
138+
VERSION="${VERSION/a/-a}"
140139
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
141140
- name: Prepare SAR App
142141
env:
@@ -149,7 +148,7 @@ jobs:
149148
150149
# fill in the SAR SAM template
151150
sed \
152-
-e "s|<VERSION>|${VERSION}|g" \
151+
-e "s|<VERSION>|${{ env.VERSION }}|g" \
153152
-e "s/<SAR_APP_NAME>/${{ env.SAR_NAME }}/g" \
154153
-e "s|<LAYER_CONTENT_PATH>|./cdk.out/$asset|g" \
155154
-e "s|<PYTHON_RUNTIME>|${{ matrix.python-version }}|g" \
@@ -165,6 +164,7 @@ jobs:
165164
166165
# Package the SAR to our SAR S3 bucket, and publish it
167166
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET_V3 }}
167+
cat packaged.yml
168168
sam publish --template packaged.yml --region "$AWS_REGION"
169169
- name: Deploy BETA canary
170170
if: ${{ inputs.stage == 'BETA' }}

0 commit comments

Comments
 (0)