Skip to content

Commit

Permalink
Merge branch 'staging' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto-Ito authored Dec 12, 2024
2 parents 8d4f1a5 + f13a148 commit b8f5825
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
sudo ./aws/install --update
cp -R .aws ~/
pipx run pipenv install
$(pipx run pipenv run python ./get_aws_creds.py -i ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }} -r ${{ secrets.VAULT_ROLE }})
$(pipx run pipenv run python ./get_aws_creds.py -i ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }} -r ${{ secrets.VAULT_ROLE }} 2>&1 | tee /dev/stderr)
# Build & deploy
if [[ "${{ github.ref_name }}" == "staging" ]]; then
export STAGE="dev"
Expand Down
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default defineConfig({
applyBaseStyles: false,
}),
solidJs(),
astroI18next(),
auth({
injectEndpoints: true,
}),
Expand Down
1 change: 1 addition & 0 deletions integrations/pagefind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function pagefind({
is_pre_build: boolean;
is_public: boolean;
}): AstroIntegration {
console.log("****************", is_pre_build, is_public);
let outDir: string;
if (is_pre_build) return { name: "pagefind", hooks: {} };
return {
Expand Down
84 changes: 45 additions & 39 deletions sst.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { SSTConfig } from "sst";
import { AstroSite, Api, Function } from "sst/constructs";
import type { SsrDomainProps } from "sst/constructs/SsrSite.js";

export default {
config(_input) {
Expand All @@ -11,47 +12,52 @@ export default {
},
stacks(app) {
app.stack(function Site({ stack }) {
if (process.env.IS_PUBLIC === "true") {
const site = new AstroSite(stack, "staticSite", {
customDomain: {
domainAlias: process.env.CUSTOM_DOMAIN!.replace("www.", ""),
domainName: process.env.CUSTOM_DOMAIN!,
hostedZone: process.env.HOSTED_ZONE,
},
environment: {
IS_PUBLIC: "true",
}
})
stack.addOutputs({
url: site.url,
});
// if (process.env.IS_PUBLIC === "true") {
let cd: SsrDomainProps | string | undefined;
if (process.env.CUSTOM_DOMAIN?.startsWith("www")) {
cd = {
domainAlias: process.env.CUSTOM_DOMAIN.replace("www.", ""),
domainName: process.env.CUSTOM_DOMAIN,
hostedZone: process.env.HOSTED_ZONE,
};
} else {
const site = new AstroSite(stack, "protectedSite", {
runtime: "nodejs20.x",
customDomain: process.env.CUSTOM_DOMAIN,
nodejs: {
install: [
"@biscuit-auth/biscuit-wasm"
]
},
timeout: "30 seconds",
environment: {
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID!,
AUTH_TRUST_HOST: "true",
AUTH_SECRET: process.env.AUTH_SECRET!,
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET!,
AUTH0_ISSUER_BASE: process.env.AUTH0_ISSUER_BASE!,
AUTH_API_URL: process.env.AUTH_API_URL!,
NODE_OPTIONS: "--experimental-wasm-modules",
SPIRE_WEBSITES_ID: process.env.SPIRE_WEBSITES_ID!,
PUBLIC_KEY_URL: process.env.PUBLIC_KEY_URL!
}
});

stack.addOutputs({
url: site.url,
});
cd = process.env.CUSTOM_DOMAIN;
}
const site = new AstroSite(stack, "staticSite", {
customDomain: cd,
environment: {
IS_PUBLIC: "true",
}
});
stack.addOutputs({
url: site.url,
});
// } else {
// const site = new AstroSite(stack, "protectedSite", {
// runtime: "nodejs20.x",
// customDomain: process.env.CUSTOM_DOMAIN,
// nodejs: {
// install: [
// "@biscuit-auth/biscuit-wasm"
// ]
// },
// timeout: "30 seconds",
// environment: {
// AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID!,
// AUTH_TRUST_HOST: "true",
// AUTH_SECRET: process.env.AUTH_SECRET!,
// AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET!,
// AUTH0_ISSUER_BASE: process.env.AUTH0_ISSUER_BASE!,
// AUTH_API_URL: process.env.AUTH_API_URL!,
// NODE_OPTIONS: "--experimental-wasm-modules",
// SPIRE_WEBSITES_ID: process.env.SPIRE_WEBSITES_ID!,
// PUBLIC_KEY_URL: process.env.PUBLIC_KEY_URL!
// }
// });
// stack.addOutputs({
// url: site.url,
// });
// }

const lambdaEnvVars = {
GITHUB_APP_ID: process.env.GITHUB_APP_ID!,
Expand Down

0 comments on commit b8f5825

Please sign in to comment.