From 3811099a890676f58f06618efee40cecb0bc5885 Mon Sep 17 00:00:00 2001 From: harold Date: Wed, 14 Jun 2023 15:54:07 -0400 Subject: [PATCH 1/2] Add deploy of demo iframe app for /api/ testing --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 388644f1..ad734259 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ env: # Set env to prod so we don't get an env suffix on the DNS names NODE_ENV: ${{ secrets.NODE_ENV }} DEMO_APP_NAME: demo-app + DEMO_IFRAME_APP_NAME: demo-iframe STATIC_APP_NAME: static-app NEXTJS_DEMO_APP_NAME: nextjs-demo RELEASE_APP_NAME: release @@ -355,6 +356,40 @@ jobs: echo Testing App Method Invocation on _next/data Route curl -H"accept: application/json" --fail "https://${EDGE_DOMAIN}${PREFIX}/${DEMO_APP_NAME}/_next/data/0.0.0/serverIncrement?currValue=1" + - name: Publish Demo App to MicroApps as iFrame App + API + run: | + npx pwrdrvr publish \ + --app-name ${DEMO_IFRAME_APP_NAME} \ + --type lambda-url \ + --startup-type iframe \ + --new-version 0.0.0 \ + --deployer-lambda-name ${DEPLOYER_LAMBDA_NAME} \ + --app-lambda-name ${DEMO_APP_LAMBDA_NAME} \ + --static-assets-path packages/demo-app/static_files \ + --default-file index.html \ + --overwrite + + - name: Demo IFrame App URL + uses: Sibz/github-status-action@v1 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'Demo IFrame App URL on ${{ matrix.deployName }}' + description: 'Passed' + state: 'success' + sha: ${{github.event.pull_request.head.sha || github.sha}} + target_url: https://${{ steps.getCDKExports.outputs.edgeDomain }}${{ steps.getCDKExports.outputs.prefix }}/${{ env.DEMO_IFRAME_APP_NAME }}/?appver=0.0.0 + + - name: Test Demo IFrame App + run: | + echo Testing App Frame Loading + curl -H"accept: text/html" --fail https://${EDGE_DOMAIN}${PREFIX}/${DEMO_IFRAME_APP_NAME}/ + echo Testing App HTML Loading + curl -H"accept: text/html" --fail https://${EDGE_DOMAIN}${PREFIX}/${DEMO_IFRAME_APP_NAME}/0.0.0/index.html + echo Testing App Method Invocation + curl -H"accept: application/json" --fail "https://${EDGE_DOMAIN}${PREFIX}/${DEMO_IFRAME_APP_NAME}/0.0.0/serverIncrement?currValue=1" + echo Testing App Method Invocation on _next/data Route + curl -H"accept: application/json" --fail "https://${EDGE_DOMAIN}${PREFIX}/${DEMO_IFRAME_APP_NAME}/api/serverIncrement?currValue=1" + - name: Publish Demo App to MicroApps - To Delete run: | npx pwrdrvr publish \ From f980104fff50e6afd93742698ea351f78e77d1cd Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Fri, 26 Apr 2024 16:04:01 -0400 Subject: [PATCH 2/2] Update the way status is written --- .github/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad734259..3fa6f9e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -370,14 +370,20 @@ jobs: --overwrite - name: Demo IFrame App URL - uses: Sibz/github-status-action@v1 + uses: actions/github-script@v7 with: - authToken: ${{secrets.GITHUB_TOKEN}} - context: 'Demo IFrame App URL on ${{ matrix.deployName }}' - description: 'Passed' - state: 'success' - sha: ${{github.event.pull_request.head.sha || github.sha}} - target_url: https://${{ steps.getCDKExports.outputs.edgeDomain }}${{ steps.getCDKExports.outputs.prefix }}/${{ env.DEMO_IFRAME_APP_NAME }}/?appver=0.0.0 + script: | + await github.rest.repos.createCommitStatus({ + owner: '${{ github.repository_owner }}', + repo: '${{ github.event.repository.name }}', + sha: '${{github.event.pull_request.head.sha || github.sha}}', + context: 'Demo IFrame App URL on ${{ matrix.deployName }}', + state: 'success', + description: 'Passed', + target_url: `https://${{ steps.getCDKExports.outputs.edgeDomain }}${{ steps.getCDKExports.outputs.prefix }}/${{ env.DEMO_IFRAME_APP_NAME }}?appver=${{ env.PACKAGE_VERSION }}` + }); + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test Demo IFrame App run: |