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

enh: full-stack preview app enhancements #317

Merged
17 changes: 7 additions & 10 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,28 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
- name: install sst
run: |
curl -fsSL https://ion.sst.dev/install | VERSION=0.1.51 bash
- name: set sst stage
id: get_branch_name
run: |
BRANCH_NAME=${{ github.event.pull_request.head.ref }}
SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9]/-/g')
echo "SS_STAGE=$SANITIZED_BRANCH_NAME" >> $GITHUB_OUTPUT
echo "SST_STAGE=$SANITIZED_BRANCH_NAME" >> $GITHUB_OUTPUT
- name: install dependencies
run: npm install
- name: build application
run: npm run build
- name: configure sst secrets
run: |
sst secret set PartnerId ${{ secrets.PREVIEW_PARTNER_ID }} --stage ${{ steps.get_branch_name.outputs.SS_STAGE }} &&
sst secret set CallbackUrl ${{ secrets.PREVIEW_CALLBACK_URL }} --stage ${{ steps.get_branch_name.outputs.SS_STAGE }} &&
sst secret set SmileIdApiKey ${{ secrets.PREVIEW_SMILEID_API_KEY }} --stage ${{ steps.get_branch_name.outputs.SS_STAGE }} &&
sst secret set SmileIdEnvironment ${{ secrets.PREVIEW_SMILEID_ENVIRONMENT }} --stage ${{ steps.get_branch_name.outputs.SS_STAGE }}
sst secret set PartnerId ${{ secrets.PREVIEW_PARTNER_ID }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
sst secret set CallbackUrl ${{ secrets.PREVIEW_CALLBACK_URL }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
sst secret set SmileIdApiKey ${{ secrets.PREVIEW_SMILEID_API_KEY }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }} &&
sst secret set SmileIdEnvironment ${{ secrets.PREVIEW_SMILEID_ENVIRONMENT }} --stage ${{ steps.get_branch_name.outputs.SST_STAGE }}
- name: deploy sst app
if: github.event.pull_request.merged != true
id: deploy_sst_app
run: |
sst deploy --stage=${{ steps.get_branch_name.outputs.SS_STAGE }}
sst deploy --stage=${{ steps.get_branch_name.outputs.SST_STAGE }}
- name: remove sst app
if: github.event.pull_request.merged == true
run: |
sst remove --stage=${{ steps.get_branch_name.outputs.SS_STAGE }}
sst remove --stage=${{ steps.get_branch_name.outputs.SST_STAGE }}
6 changes: 3 additions & 3 deletions previews/app/routes/products.$productName.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { LoaderFunctionArgs } from '@remix-run/node';
import { useLoaderData } from '@remix-run/react';
import { useState, useEffect } from 'react';
import { useState } from 'react';
import { Resource } from 'sst';
import products from '~/data/products.json';

declare global {
interface Window {
SmileIdentity: Function;
SmileIdentity: function;
Copy link
Collaborator

@ayinloya ayinloya Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SmileIdentity: function;
SmileIdentity: Function;

}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ export default function Product() {
...config,
document_ids: [config.document_id],
document_capture_modes: (
(config.document_capture_modes as String) ?? ''
(config.document_capture_modes as string) ?? ''
).split(','),
partner_details: {
partner_id: config.partner_id,
Expand Down
18 changes: 0 additions & 18 deletions previews/default_app/entry.client.tsx

This file was deleted.

140 changes: 0 additions & 140 deletions previews/default_app/entry.server.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions previews/default_app/root.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions previews/default_app/routes/_index.tsx

This file was deleted.

Loading
Loading