Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy of demo iframe app for /api/ testing #342

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -355,6 +356,46 @@ 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: actions/github-script@v7
with:
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: |
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 \
Expand Down
Loading