mirror of
https://github.com/wahyd4/upptime.git
synced 2026-08-18 17:46:21 +10:00
🔧 Add post-process for CNAME
This commit is contained in:
@@ -19,6 +19,8 @@ jobs:
|
||||
run: cd site && npm ci
|
||||
- name: Build site
|
||||
run: cd site && npm run export
|
||||
- name: Post process site
|
||||
run: npx ts-node site/post-process.ts
|
||||
env:
|
||||
NODE_ENV: "production"
|
||||
- uses: maxheld83/ghpages@v0.2.1
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import fs from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
export const postProcess = () => {
|
||||
const configFile = fs.readFileSync(join(".", ".statusrc.yml")).toString();
|
||||
const cnameLine = configFile
|
||||
.split("\n")
|
||||
.find((line) => line.includes("cname:"));
|
||||
if (cnameLine) {
|
||||
fs.writeFileSync(
|
||||
join(".", "site", "__export__", "CNAME"),
|
||||
cnameLine.split("cname:")[1].trim()
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
postProcess();
|
||||
Reference in New Issue
Block a user