Skip to content

Commit 226242f

Browse files
committed
chore: add production
1 parent e7fa0ae commit 226242f

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/publish_v2_layer.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ jobs:
9898
package-version: 2.0.0
9999
# package-version: ${{ needs.build-layer.outputs.release-tag-version }}
100100

101+
deploy-sar-prod:
102+
needs:
103+
- deploy-sar-beta
104+
uses: ./.github/workflows/reusable_deploy_v2_sar.yml
105+
secrets: inherit
106+
with:
107+
stage: "PROD"
108+
artefact-name: "cdk-layer-artefact"
109+
environment: "layer-prod"
110+
package-version: 2.0.0
111+
# package-version: ${{ needs.build-layer.outputs.release-tag-version }}
112+
101113
# deploy-prod:
102114
# needs:
103115
# - deploy-beta

.github/workflows/reusable_deploy_v2_sar.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Unzip artefact
6464
run: |
6565
unzip cdk.out.zip
66-
- name: Set SAR name
66+
- name: Set test SAR name
6767
run: |
6868
NAME=${{ env.SAR_NAME }}
6969
if [[ "${{ inputs.stage }}" == "BETA" ]]; then
@@ -77,13 +77,27 @@ jobs:
7777
cp README.md LICENSE "./cdk.out/$asset/"
7878
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
7979
sam publish --template packaged.yml --region "$AWS_REGION"
80+
- name: Publish x86_64 SAR
81+
if: ${{ inputs.stage == 'PROD' }}
82+
run: |
83+
# wait until sar registers the app, otherwise it fails to make it public
84+
sleep 15
85+
echo "Make x86_64 SAR app public"
86+
aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }} --statements Principals='*',Actions=Deploy
8087
- name: Deploy arm64 SAR
8188
run: |
8289
asset=$(jq -jc '.Resources[] | select(.Properties.CompatibleArchitectures == ["arm64"]) | .Metadata."aws:asset:path"' cdk.out/LayerV2Stack.template.json)
8390
sed -e "s|<VERSION>|${{ inputs.package-version }}|g" -e "s/<SAR_APP_NAME>/${{ env.SAR_NAME }}-arm64/g" -e "s|<LAYER_CONTENT_PATH>|./cdk.out/$asset|g" layer/sar/template.txt > template.yml
8491
cp README.md LICENSE "./cdk.out/$asset/"
8592
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
8693
sam publish --template packaged.yml --region "$AWS_REGION"
94+
- name: Publish arm64 SAR
95+
if: ${{ inputs.stage == 'PROD' }}
96+
run: |
97+
# wait until sar registers the app, otherwise it fails to make it public
98+
sleep 15
99+
echo "Make arm64 SAR app public"
100+
aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }}-arm64 --statements Principals='*',Actions=Deploy
87101
- name: Deploy BETA canary
88102
if: ${{ inputs.stage == 'BETA' }}
89103
run: |

0 commit comments

Comments
 (0)