From f1efbde3358c3ef9971eb473431a64928d68477d Mon Sep 17 00:00:00 2001 From: mitchell Date: Sun, 23 Jun 2024 22:59:38 -0400 Subject: [PATCH] Handle no JS case better, and refactor deploy script --- components/ContactButtons.vue | 84 +++++++++++++++++++++-------------- components/RepoButton.vue | 9 +--- contact.md | 11 ++++- deploy.ts | 22 ++++++--- package.json | 2 +- 5 files changed, 79 insertions(+), 49 deletions(-) diff --git a/components/ContactButtons.vue b/components/ContactButtons.vue index d312954..00d9039 100644 --- a/components/ContactButtons.vue +++ b/components/ContactButtons.vue @@ -1,54 +1,70 @@ diff --git a/components/RepoButton.vue b/components/RepoButton.vue index eab5d23..a94ec12 100644 --- a/components/RepoButton.vue +++ b/components/RepoButton.vue @@ -1,16 +1,11 @@ diff --git a/contact.md b/contact.md index 14f03e7..c4fd8d0 100644 --- a/contact.md +++ b/contact.md @@ -1,14 +1,23 @@ --- -layout: home +layout: page +sidebar: false hero: name: "Mitchell Simon" text: "Software Engineer" tagline: Specializing in web, mobile, and dev-ops + +features: + - title: Enable JavaScript + details: + Please, enable JS to show contact info. This is to prevent malicious bots from scraping + the info. --- + diff --git a/deploy.ts b/deploy.ts index b4f69ae..0e3176f 100755 --- a/deploy.ts +++ b/deploy.ts @@ -1,11 +1,21 @@ #!/usr/bin/env bun import { $ } from "bun"; -await $`bun run clean`; -await $`bun run build`; +async function main() { + const profile = process.env.MJFS_PROFILE; + const distId = process.env.MJFS_DIST_ID; -const profile = prompt("Profile:"); -const distId = prompt("Distribution Id:"); + if ( + !confirm(`Deploy to distribution "${distId}" with profile "${profile}"?`) + ) { + return; + } -await $`aws s3 sync ./.vitepress/dist/ s3://mjfs.us --acl public-read --delete --profile ${profile} --region us-west-1`; -await $`aws cloudfront create-invalidation --distribution-id ${distId} --paths '/*' --profile ${profile}`; + await $`bun run clean`; + await $`bun run build`; + + await $`aws s3 sync ./.vitepress/dist/ s3://mjfs.us --acl public-read --delete --profile ${profile} --region us-west-1`; + await $`aws cloudfront create-invalidation --distribution-id ${distId} --paths '/*' --profile ${profile}`; +} + +await main(); diff --git a/package.json b/package.json index b250c14..b2cd4a2 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "scripts": { "dev": "bunx --bun vitepress dev", "build": "bunx --bun vitepress build", - "preview": "bunx --bun vitepress preview", + "preview": "caddy file-server --listen :5173 --root ./.vitepress/dist/", "typecheck": "bunx --bun vue-tsc", "format": "bunx --bun prettier -w .", "lint": "bunx --bun eslint .",