Deploy config
This commit is contained in:
parent
44819da59d
commit
f5ccd2a692
33
.cpanel.yml
Normal file
33
.cpanel.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
deployment:
|
||||
tasks:
|
||||
- export DEPLOY_PATH=/home4/educa7ls/staging.eegsac.com
|
||||
# Install dependencies
|
||||
- pnpm i --frozen-lockfile
|
||||
# Build Nestjs
|
||||
- pnpm build
|
||||
# Build JSX files
|
||||
- node ./esbuild-prod.js
|
||||
# Build hydration script
|
||||
- node ./esbuild-client-prod.js
|
||||
# Build tailwind
|
||||
- ./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
|
||||
|
||||
# Remove previous deployments
|
||||
- rm -rf $DEPLOY_PATH/*
|
||||
|
||||
# Move files to deploy path
|
||||
- /bin/cp -r ./dist $DEPLOY_PATH
|
||||
- /bin/cp -r ./static $DEPLOY_PATH
|
||||
- /bin/cp ./package.json $DEPLOY_PATH
|
||||
- /bin/cp ./pnpm-lock.yaml $DEPLOY_PATH
|
||||
- /bin/cp ./.htaccess $DEPLOY_PATH
|
||||
|
||||
# Remove build dependencies
|
||||
- rm -rf ./node_modules
|
||||
|
||||
# Install prod deps
|
||||
- cd $DEPLOY_PATH
|
||||
- pnpm i --frozen-lockfile --prod
|
||||
|
||||
# Success??
|
8
.htaccess
Normal file
8
.htaccess
Normal file
@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ "http://127.0.0.1:3000/$1" [P]
|
||||
</IfModule>
|
22
esbuild-client-prod.js
Normal file
22
esbuild-client-prod.js
Normal file
@ -0,0 +1,22 @@
|
||||
const { build } = require("esbuild");
|
||||
const { solidPlugin } = require("esbuild-plugin-solid");
|
||||
|
||||
build({
|
||||
platform: "browser",
|
||||
entryPoints: [
|
||||
"src/views/hydration.ts",
|
||||
],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
logLevel: "info",
|
||||
plugins: [
|
||||
solidPlugin({
|
||||
solid: {
|
||||
generate: "dom",
|
||||
hydratable: true,
|
||||
},
|
||||
})
|
||||
],
|
||||
outdir: "static",
|
||||
format: "cjs",
|
||||
});
|
26
esbuild-prod.js
Normal file
26
esbuild-prod.js
Normal file
@ -0,0 +1,26 @@
|
||||
const { build, context } = require("esbuild");
|
||||
const { solidPlugin } = require("esbuild-plugin-solid");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const { glob } = require("glob");
|
||||
|
||||
(async() => {
|
||||
const files = await glob("dist/**/*.jsx");
|
||||
|
||||
build({
|
||||
platform: "node",
|
||||
entryPoints: files,
|
||||
bundle: false,
|
||||
minify: true,
|
||||
logLevel: "info",
|
||||
plugins: [solidPlugin({
|
||||
solid: {
|
||||
generate: "ssr",
|
||||
hydratable: true,
|
||||
},
|
||||
})],
|
||||
outdir: "dist",
|
||||
outbase: "dist",
|
||||
format: "cjs",
|
||||
});
|
||||
})();
|
2153
pnpm-lock.yaml
2153
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user