@@ -5,12 +5,12 @@ name: CI
55
66on :
77 push :
8- branches : [ main ]
8+ branches : [main]
99 paths :
1010 - ' **'
1111 - ' !**/README.md'
1212 pull_request :
13- branches : [ main ]
13+ branches : [main]
1414 paths :
1515 - ' **'
1616 - ' !**/README.md'
2121 # Set env to prod so we don't get an env suffix on the DNS names
2222 NODE_ENV : ${{ secrets.NODE_ENV }}
2323 DEMO_APP_NAME : demo-app
24+ STATIC_APP_NAME : static-app
2425 NEXTJS_DEMO_APP_NAME : nextjs-demo
2526 RELEASE_APP_NAME : release
2627 AWS_REGION : us-east-2
@@ -101,8 +102,8 @@ jobs:
101102
102103 - name : Optionally Build All TypeScript
103104 if : steps.cache-typescript-build.outputs.cache-hit != 'true'
104- run : yarn build
105-
105+ run : yarn build
106+
106107 - name : Run Lint
107108 run : yarn lint
108109
@@ -230,17 +231,19 @@ jobs:
230231
231232 - name : Build Edge-to-Origin for Local Deploy
232233 run : yarn esbuild:edge-to-origin
233-
234+
234235 - name : Configure AWS Credentials
235236 uses : aws-actions/configure-aws-credentials@v2
236237 with :
237238 role-session-name : microapps-ghpublic-build
238239 role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/builder-writeRole
239240 aws-region : ${{ env.AWS_REGION }}
240241
241- - name : Stitch Version and Prefix into Simple Demo App
242+ - name : Stitch Version and Prefix into Simple Demo App and Static App
242243 run : |
243- npx replace-in-file "/\/0\.0\.0/g" ${PREFIX}/${PACKAGE_VERSION} --configFile=.demo-app-replace.config.js --isRegex
244+ npx replace-in-file "/\/0\.0\.0/g" ${PREFIX}/${PACKAGE_VERSION} --configFile=.demo-app-replace.config.js --isRegex
245+ npx replace-in-file "/0\.0\.0/g" ${PACKAGE_VERSION} --configFile=.demo-app-replace.config.js --isRegex
246+ npx replace-in-file "/0\.0\.0/g" ${PACKAGE_VERSION} --configFile=.static-app-replace.config.js --isRegex
244247
245248 - name : Stitch Prefix into Nextjs Demo App
246249 run : |
@@ -307,17 +310,17 @@ jobs:
307310 id : getCDKExports
308311 run : |
309312 echo "prefix="${PREFIX} >> $GITHUB_OUTPUT
310- echo "edgeDomain="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-domain-name\`].Value" --no-paginate --output text) >> $GITHUB_OUTPUT
311- echo "EDGE_DOMAIN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-domain-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
312- echo "EDGE_TO_ORIGIN_ROLE_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-role-role-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
313- echo "DEPLOYER_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
314- echo "DEPLOYER_LAMBDA_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
315- echo "DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-func-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
316- echo "DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-vers-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
317- echo "NEXTJS_DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-nextjs-demo-app-func-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
318- echo "NEXTJS_DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-nextjs-demo-app-vers-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
319- echo "RELEASE_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-release-app-func-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
320- echo "RELEASE_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-release-app-vers-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
313+ echo "edgeDomain="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-domain-name\`].Value" --output text) >> $GITHUB_OUTPUT
314+ echo "EDGE_DOMAIN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-domain-name\`].Value" --output text) >> $GITHUB_ENV
315+ echo "EDGE_TO_ORIGIN_ROLE_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-edge-role-role-arn\`].Value" --output text) >> $GITHUB_ENV
316+ echo "DEPLOYER_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-name\`].Value" --output text) >> $GITHUB_ENV
317+ echo "DEPLOYER_LAMBDA_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-arn\`].Value" --output text) >> $GITHUB_ENV
318+ echo "DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-func-name\`].Value" --output text) >> $GITHUB_ENV
319+ echo "DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-vers-arn\`].Value" --output text) >> $GITHUB_ENV
320+ echo "NEXTJS_DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-nextjs-demo-app-func-name\`].Value" --output text) >> $GITHUB_ENV
321+ echo "NEXTJS_DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-nextjs-demo-app-vers-arn\`].Value" --output text) >> $GITHUB_ENV
322+ echo "RELEASE_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-release-app-func-name\`].Value" --output text) >> $GITHUB_ENV
323+ echo "RELEASE_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghpublic-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-release-app-vers-arn\`].Value" --output text) >> $GITHUB_ENV
321324
322325 - name : Echo Exports
323326 run : |
@@ -337,6 +340,16 @@ jobs:
337340 --url https://www.pwrdrvr.com \
338341 --overwrite
339342
343+ - name : Publish Static App to Child MicroApps
344+ run : |
345+ npx microapps-publish publish-static \
346+ --app-name ${STATIC_APP_NAME} \
347+ --new-version 0.0.0 \
348+ --deployer-lambda-name ${DEPLOYER_LAMBDA_ARN} \
349+ --static-assets-path packages/static-app/src \
350+ --default-file index.html \
351+ --overwrite
352+
340353 - name : Publish Demo App to MicroApps
341354 run : |
342355 npx microapps-publish publish \
@@ -352,7 +365,7 @@ jobs:
352365
353366 - name : Demo App URL
354367 uses : Sibz/github-status-action@v1
355- with :
368+ with :
356369 authToken : ${{secrets.GITHUB_TOKEN}}
357370 context : ' Demo App URL on ${{ matrix.deployName }}'
358371 description : ' Passed'
@@ -407,7 +420,7 @@ jobs:
407420
408421 - name : Demo App URL - Root App
409422 uses : Sibz/github-status-action@v1
410- with :
423+ with :
411424 authToken : ${{secrets.GITHUB_TOKEN}}
412425 context : ' Demo App (Root App) URL on ${{ matrix.deployName }}'
413426 description : ' Passed'
@@ -440,7 +453,7 @@ jobs:
440453
441454 - name : Nextjs Demo App URL
442455 uses : Sibz/github-status-action@v1
443- with :
456+ with :
444457 authToken : ${{secrets.GITHUB_TOKEN}}
445458 context : ' Nextjs Demo App URL on ${{ matrix.deployName }}'
446459 description : ' Passed'
@@ -472,7 +485,7 @@ jobs:
472485
473486 - name : Release App URL
474487 uses : Sibz/github-status-action@v1
475- with :
488+ with :
476489 authToken : ${{secrets.GITHUB_TOKEN}}
477490 context : ' Release App URL on ${{ matrix.deployName }}'
478491 description : ' Passed'
@@ -516,10 +529,10 @@ jobs:
516529 if : ${{ matrix.deployName == 'microapps-core' }}
517530 id : getChildCDKExports
518531 run : |
519- echo "CHILD_DEPLOYER_LAMBDA_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
520- echo "CHILD_DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-func-name\`].Value" --no-paginate --output text) >> $GITHUB_ENV
521- echo "CHILD_DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-vers-arn\`].Value" --no-paginate --output text) >> $GITHUB_ENV
522-
532+ echo "CHILD_DEPLOYER_LAMBDA_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-deployer-func-arn\`].Value" --output text) >> $GITHUB_ENV
533+ echo "CHILD_DEMO_APP_LAMBDA_NAME="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-func-name\`].Value" --output text) >> $GITHUB_ENV
534+ echo "CHILD_DEMO_APP_LAMBDA_VERSION_ARN="$(aws cloudformation list-exports --query "Exports[?Name==\`${{ matrix.deployName }}-ghchild-${NODE_ENV}${{ needs.build.outputs.prSuffix }}-demo-app-vers-arn\`].Value" --output text) >> $GITHUB_ENV
535+
523536 - name : Echo Exports
524537 if : ${{ matrix.deployName == 'microapps-core' }}
525538 run : |
@@ -637,8 +650,8 @@ jobs:
637650 jq ".compilerOptions += { \"skipLibCheck\": true }" packages/microapps-cdk/tsconfig.jsii.json > packages/microapps-cdk/tsconfig.json
638651
639652 - name : Build All TypeScript
640- run : yarn build
641-
653+ run : yarn build
654+
642655 - name : Install CDK Construct Deps
643656 working-directory : packages/microapps-cdk/
644657 run : yarn install --frozen-lockfile
0 commit comments