Fixed custom domain deployment bug
This commit is contained in:
parent
ae6b8209b6
commit
a396cbaf88
3 changed files with 9 additions and 4 deletions
|
|
@ -11,9 +11,9 @@
|
|||
"repository": "https://github.com/Prozilla/ProzillaOS",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite --port 3000 --host",
|
||||
"start": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"serve": "vite preview --port 8080 --host",
|
||||
"serve": "vite preview --port 8080",
|
||||
"stage": "tsx scripts/stage",
|
||||
"predeploy": "npm run build && npm run stage",
|
||||
"deploy": "tsx scripts/deploy",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ function deploy() {
|
|||
|
||||
void ghpages.publish(BUILD_DIR, {
|
||||
repo: REPO_URL,
|
||||
cname: DOMAIN,
|
||||
message: COMMIT_MESSAGE
|
||||
}, (error) => {
|
||||
if (error == null)
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ import { APP_DESCRIPTIONS, APP_NAMES, APPS } from "../src/config/apps.config";
|
|||
import { ANSI } from "../src/config/apps/terminal.config";
|
||||
import { NAME, TAG_LINE } from "../src/config/branding.config";
|
||||
import { WALLPAPERS } from "../src/config/desktop.config";
|
||||
import { BASE_URL, BUILD_DIR } from "../src/config/deploy.config";
|
||||
import { BASE_URL, BUILD_DIR, DOMAIN } from "../src/config/deploy.config";
|
||||
|
||||
const PATHS = {
|
||||
sitemapXml: BUILD_DIR + "/sitemap.xml",
|
||||
robotsTxt: BUILD_DIR + "/robots.txt",
|
||||
indexHtml: BUILD_DIR + "/index.html",
|
||||
cname: BUILD_DIR + "/CNAME",
|
||||
};
|
||||
|
||||
function generateSitemapXml() {
|
||||
|
|
@ -53,6 +54,10 @@ Disallow:
|
|||
Sitemap: ${sitemapUrl}`;
|
||||
}
|
||||
|
||||
function generateCname() {
|
||||
return DOMAIN;
|
||||
}
|
||||
|
||||
function generateTemplate(html: string) {
|
||||
const baseUrlRegex = /(?<=")https?:\/\/[a-z0-9-]+(\.)([a-zA-Z0-9-]+(\.))*[a-z]{2,3}\/(?=.*")/gi;
|
||||
html = html.replaceAll(baseUrlRegex, BASE_URL);
|
||||
|
|
@ -121,6 +126,7 @@ function stage() {
|
|||
const files: [string, () => string][] = [
|
||||
[PATHS.sitemapXml, generateSitemapXml],
|
||||
[PATHS.robotsTxt, generateRobotsTxt],
|
||||
[PATHS.cname, generateCname],
|
||||
];
|
||||
|
||||
files.forEach(([path, generateContent]) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue