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