Skip to content

Commit

Permalink
skip CI for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chanind committed Mar 10, 2019
1 parent 2f78613 commit 575524d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tools/gh-pages-publish.ts
@@ -1,31 +1,31 @@
const { cd, exec, echo, touch } = require('shelljs')
const { readFileSync } = require('fs')
const url = require('url')
const { cd, exec, echo, touch } = require('shelljs');
const { readFileSync } = require('fs');
const url = require('url');

let repoUrl
let pkg = JSON.parse(readFileSync('package.json'))
let repoUrl;
let pkg = JSON.parse(readFileSync('package.json'));
if (typeof pkg.repository === 'object') {
if (!pkg.repository.hasOwnProperty('url')) {
throw new Error('URL does not exist in repository section')
throw new Error('URL does not exist in repository section');
}
repoUrl = pkg.repository.url
repoUrl = pkg.repository.url;
} else {
repoUrl = pkg.repository
repoUrl = pkg.repository;
}

let parsedUrl = url.parse(repoUrl)
let repository = (parsedUrl.host || '') + (parsedUrl.path || '')
let ghToken = process.env.GH_TOKEN
let parsedUrl = url.parse(repoUrl);
let repository = (parsedUrl.host || '') + (parsedUrl.path || '');
let ghToken = process.env.GH_TOKEN;

echo('Deploying docs!!!')
cd('docs')
touch('.nojekyll')
exec('git init')
exec('git add .')
exec('git config user.name "David Chanin"')
exec('git config user.email "chanindav@gmail.com"')
exec('git commit -m "docs(docs): update gh-pages"')
echo('Deploying docs!!!');
cd('docs');
touch('.nojekyll');
exec('git init');
exec('git add .');
exec('git config user.name "David Chanin"');
exec('git config user.email "chanindav@gmail.com"');
exec('git commit -m "[ci skip] docs(docs): update gh-pages"');
exec(
`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
)
echo('Docs deployed!!')
);
echo('Docs deployed!!');

0 comments on commit 575524d

Please sign in to comment.