Skip to content

Commit

Permalink
Merge pull request #12 from DeterminateSystems/fix-deploy-previews
Browse files Browse the repository at this point in the history
Fix Netlify deploy previews
  • Loading branch information
lucperkins committed May 15, 2024
2 parents ebf1e49 + cddc376 commit fcec8cc
Show file tree
Hide file tree
Showing 4 changed files with 976 additions and 706 deletions.
10 changes: 10 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
[build]
command = "pnpm run build"
publish = "out"

[build.environment]
NODE_ENV = "production"

[context.production.environment]
PREVIEW = "false"

[context.branch-deploy.environment]
PREVIEW = "true"

[context.deploy-preview.environment]
PREVIEW = "true"
6 changes: 3 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nextra from "nextra";

const isProd = process.env.NODE_ENV === "production";
const isPreview = process.env.PREVIEW === "true";

const withNextra = nextra({
codeHighlight: true,
Expand All @@ -10,8 +10,8 @@ const withNextra = nextra({
});

export default withNextra({
assetPrefix: isProd ? "https://flakehub.com/docs" : undefined,
basePath: isProd ? "/docs" : undefined,
assetPrefix: isPreview ? undefined : "https://flakehub.com/docs",
basePath: isPreview ? undefined : "/docs",
images: {
unoptimized: true,
},
Expand Down
34 changes: 16 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@
"format": "prettier --write ."
},
"dependencies": {
"@tailwindcss/typography": "^0.5.10",
"clsx": "^2.0.0",
"isomorphic-dompurify": "^1.9.0",
"marked": "^5.1.2",
"next": "^14.1.1",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.11.0"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.13",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^20.9.0",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"tailwindcss": "^3.3.5",
"@types/node": "^20.12.12",
"autoprefixer": "^10.4.19",
"clsx": "^2.1.1",
"isomorphic-dompurify": "^1.13.0",
"marked": "^5.1.2",
"next": "^14.2.3",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^4.12.0",
"tailwindcss": "^3.4.3",
"typescript": "5.2.2"
}
}
Loading

0 comments on commit fcec8cc

Please sign in to comment.