2024-06-22 23:14:46 +00:00
|
|
|
#!/usr/bin/env bun
|
|
|
|
import { $ } from "bun";
|
|
|
|
|
2024-06-24 02:59:38 +00:00
|
|
|
async function main() {
|
|
|
|
const profile = process.env.MJFS_PROFILE;
|
|
|
|
const distId = process.env.MJFS_DIST_ID;
|
2024-06-22 23:14:46 +00:00
|
|
|
|
2024-06-24 02:59:38 +00:00
|
|
|
if (
|
|
|
|
!confirm(`Deploy to distribution "${distId}" with profile "${profile}"?`)
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
2024-06-22 23:14:46 +00:00
|
|
|
|
2024-06-24 02:59:38 +00:00
|
|
|
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();
|