Skip to content

Commit

Permalink
check if out folder exists, if not, throw error (#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Jun 6, 2024
1 parent e274859 commit fedcc79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-local-preview-bundle-dryrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm --filter=@fern-ui/local-preview-bundle build
- name: Synthesize local preview bundle
run: pnpm --filter=@fern-ui/cdk run synth:dev2

Expand All @@ -44,6 +44,6 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm --filter=@fern-ui/local-preview-bundle build
- name: Synthesize local preview bundle
run: pnpm --filter=@fern-ui/cdk run synth:prod
4 changes: 2 additions & 2 deletions .github/workflows/deploy-local-preview-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: ENABLE_SOURCE_MAPS=true pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: ENABLE_SOURCE_MAPS=true pnpm --filter=@fern-ui/local-preview-bundle build
- name: Deploy local preview bundle
run: pnpm --filter=@fern-ui/cdk run deploy:dev2

Expand All @@ -47,6 +47,6 @@ jobs:
- name: Install
uses: ./.github/actions/install
- name: Build local preview bundle
run: pnpm turbo --filter=@fern-ui/local-preview-bundle build
run: pnpm --filter=@fern-ui/local-preview-bundle build
- name: Deploy local preview bundle
run: pnpm --filter=@fern-ui/cdk run deploy:prod
4 changes: 4 additions & 0 deletions packages/cdk/src/docs-fe-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class DocsFeStack extends Stack {
);

const local_preview_bundle_dist_zip = path.resolve(__dirname, "../../ui/local-preview-bundle/dist/out.zip");
if (!fs.existsSync(LOCAL_PREVIEW_BUNDLE_OUT_DIR) || !fs.lstatSync(LOCAL_PREVIEW_BUNDLE_OUT_DIR).isDirectory()) {
throw new Error(`Local preview bundle not found at ${LOCAL_PREVIEW_BUNDLE_OUT_DIR}`);
}

void zipFolder(LOCAL_PREVIEW_BUNDLE_OUT_DIR, local_preview_bundle_dist_zip).then(() => {
new BucketDeployment(this, "deploy-local-preview-bundle2", {
sources: [Source.asset(local_preview_bundle_dist_zip)],
Expand Down

0 comments on commit fedcc79

Please sign in to comment.