Skip to content

Commit 03476d6

Browse files
committed
chore: skip CI for docs build
1 parent 911c157 commit 03476d6

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

tools/gh-pages-publish.ts

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
1-
const { cd, exec, echo, touch } = require("shelljs")
2-
const { readFileSync } = require("fs")
3-
const url = require("url")
1+
const { cd, exec, echo, touch } = require('shelljs');
2+
const { readFileSync } = require('fs');
3+
const url = require('url');
44

5-
let repoUrl
6-
let pkg = JSON.parse(readFileSync("package.json") as any)
7-
if (typeof pkg.repository === "object") {
8-
if (!pkg.repository.hasOwnProperty("url")) {
9-
throw new Error("URL does not exist in repository section")
5+
let repoUrl;
6+
let pkg = JSON.parse(readFileSync('package.json') as any);
7+
if (typeof pkg.repository === 'object') {
8+
if (!pkg.repository.hasOwnProperty('url')) {
9+
throw new Error('URL does not exist in repository section');
1010
}
11-
repoUrl = pkg.repository.url
11+
repoUrl = pkg.repository.url;
1212
} else {
13-
repoUrl = pkg.repository
13+
repoUrl = pkg.repository;
1414
}
1515

16-
let parsedUrl = url.parse(repoUrl)
17-
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
18-
let ghToken = process.env.GH_TOKEN
16+
let parsedUrl = url.parse(repoUrl);
17+
let repository = (parsedUrl.host || '') + (parsedUrl.path || '');
18+
let ghToken = process.env.GH_TOKEN;
1919

20-
echo("Deploying docs!!!")
21-
cd("docs")
22-
touch(".nojekyll")
23-
exec("git init")
24-
exec("git add .")
25-
exec('git config user.name "David Chanin"')
26-
exec('git config user.email "[email protected]"')
27-
exec('git commit -m "docs(docs): update gh-pages"')
28-
exec(
29-
`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
30-
)
31-
echo("Docs deployed!!")
20+
echo('Deploying docs!!!');
21+
cd('docs');
22+
touch('.nojekyll');
23+
exec('git init');
24+
exec('git add .');
25+
exec('git config user.name "David Chanin"');
26+
exec('git config user.email "[email protected]"');
27+
exec('git commit -m "[ci skip] docs(docs): update gh-pages"');
28+
exec(`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`);
29+
echo('Docs deployed!!');

0 commit comments

Comments
 (0)