Skip to content

Commit

Permalink
workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Mar 7, 2024
1 parent 38924fb commit d3a006b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:

- name: deploy
run: |
cd www
bun install
cd www
go run ../cmd/sst deploy --stage=production
Binary file added bun.lockb
Binary file not shown.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ion",
"workspaces": [
"www",
"pkg/platform",
"sdk/js"
]
}
2 changes: 1 addition & 1 deletion pkg/platform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "sst",
"name": "@sst/platform",
"type": "module",
"prettier": {},
"scripts": {
Expand Down
27 changes: 9 additions & 18 deletions www/sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export default $config({
},
async run() {
const isPersonal = $app.stage !== "production" && $app.stage !== "dev";
const domain =
{
production: "ion.sst.dev",
dev: "dev.ion.sst.dev",
}[$app.stage] || $app.stage + "dev.ion.sst.dev";

if (!isPersonal) {
const oidc = new aws.iam.OpenIdConnectProvider("GithubOidc", {
Expand Down Expand Up @@ -51,27 +56,13 @@ export default $config({
role: role.name,
policyArn: aws.iam.ManagedPolicies.AdministratorAccess,
});
new aws.route53.Zone("Zone", {
name: domain,
});
}

const domain =
{
production: "ion.sst.dev",
dev: "dev.ion.sst.dev",
}[$app.stage] || $app.stage + "dev.ion.sst.dev";

const zone = isPersonal
? await aws.route53.getZone({
name: domain,
})
: new aws.route53.Zone("Zone", {
name: domain,
});

new sst.aws.Astro("Astro", {
domain: {
domainName: domain,
hostedZoneId: zone.zoneId,
},
domain,
});
},
});

0 comments on commit d3a006b

Please sign in to comment.