How to use the gh-pages.publish function in gh-pages

To help you get started, we’ve selected a few gh-pages examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github saschwarz / react-svgpathplayer / lib / deploy_gh_pages.js View on Github external
function main() {
  ghpages.publish(config.output.path,
                  // needed when running on travis-ci
                  {
                      user: {
                          name: 'Steve Schwarz',
                          email: 'steve@agilitynerd.com'
                      },
                      repo: 'https://' + process.env.GH_TOKEN + '@' + process.env.GH_REF
                  },
                  console.error.bind(console));
}
github NationalBankBelgium / stark / packages / stark-build / config / webpack.github-deploy.js View on Github external
const options = {
						logger: logger,
						remote: GIT_REMOTE_NAME,
						message: COMMIT_MESSAGE,
						dotfiles: true // for .nojekyll
					};
					/**
					 * Since GitHub moved to Jekyll 3.3, their server ignores the "node_modules" and "vendors" folder by default.
					 * but, as of now, it also ignores "vendors*" files.
					 * This means vendor.bundle.js or vendor.[chunk].bundle.js will return 404.
					 * this is the fix for now.
					 */
					fs.writeFileSync(path.join(webpackConfig.output.path, ".nojekyll"), "");

					const ghpages = require("gh-pages");
					ghpages.publish(webpackConfig.output.path, options, function(err) {
						if (err) {
							console.log("GitHub deployment done. STATUS: ERROR.");
							throw err;
						} else {
							console.log("GitHub deployment done. STATUS: SUCCESS.");
						}
					});
				});
			}
github any86 / any-touch / scripts / demo.js View on Github external
var ghpages = require('gh-pages');
const shell = require('shelljs');
const chalk = require('chalk');

shell.rm('-rf', './demo');
shell.mkdir('-p','./demo/dist');
shell.mkdir('-p','./demo/example');
shell.cp('-Rf', './example/*', './demo/example');
shell.cp('-Rf', './dist/*', './demo/dist');


// 发布
ghpages.publish('./demo', {
    branch: 'gh-pages',
}, (err) => {
    if(err) {
        console.log(chalk.red(err));
    } else {
        shell.rm('-rf', './demo');
        console.log(chalk.green('demo同步完成!'));
    }
});
github shlomiassaf / ngx-modialog / config / webpack.github-deploy.js View on Github external
remote: GIT_REMOTE_NAME,
           message: COMMIT_MESSAGE,
           dotfiles: true // for .nojekyll
         };
         /**
          * Since GitHub moved to Jekyll 3.3, their server ignores the "node_modules" and "vendors" folder by default.
          * but, as of now, it also ignores "vendors*" files.
          * This means vendor.bundle.js or vendor.[chunk].bundle.js will return 404.
          * this is the fix for now.
          */
         fs.writeFileSync(path.join(webpackConfig.output.path, '.nojekyll'), '');

         execSync(`npm run docs -- -d ${webpackConfig.output.path}/documentation`, {stdio:[0,1,2]});

         const ghpages = require('gh-pages');
         ghpages.publish(webpackConfig.output.path, options, function(err) {
           if (err) {
             console.log('GitHub deployment done. STATUS: ERROR.');
             throw err;
           } else {
             console.log('GitHub deployment done. STATUS: SUCCESS.');
           }
         });
       });
     }
github Cognizant-CDE-Australia / generator-confit / config / docs / publish.js View on Github external
// If we are running inside Travis, send the token
if (process.env.GH_TOKEN) {
  options.repo = 'https://' + process.env.GH_TOKEN + '@github.com/odecee/generator-confit.git';

  // Add some user information for the gh-pages commit
  options.user = {
    email: 'gh-pages@github',
    name: 'GH Pages Committer'
  };
}
// END_CONFIT_GENERATED_CONTENT



// START_CONFIT_GENERATED_CONTENT
ghpages.publish(docOutputDir, options, callback);


// END_CONFIT_GENERATED_CONTENT
github ncform / ncform / scripts / gen-doc.js View on Github external
// cp.exec('npm run docs', err => {
  //   if (!err) {
  //     ghPages.publish('./docs/_book', err => {
  //       if (!err) {
  //         spinner.succeed('Publish successfully.')
  //       } else {
  //         spinner.fail(err)
  //       }
  //     })
  //   } else {
  //     spinner.fail(err)
  //   }
  // })

  const spinner = ora("Publishing gitbooks...").start();
  ghPages.publish("./docs/_book", err => {
    if (!err) {
      spinner.succeed("Publish successfully.");
    } else {
      spinner.fail(err);
    }
  });
}
github pixijs / pixi-filters / scripts / gh-pages.js View on Github external
#!/usr/bin/env node

var ghpages = require('gh-pages');
var path = require('path');
var packageInfo = require(path.join(__dirname, '..', 'package.json'));
var options = {
    src: [
        'bin/filters.js',
        'bin/filters.js.map',
        'examples/**/*',
        'docs/**/*'
    ],
    message: packageInfo.version
};

ghpages.publish(process.cwd(), options, function(err) {
    if (err) {
        console.log(err);
        process.exit(1);
        return;
    }
    process.exit(0);
});
github sqrthree / lite / scripts / deploy.js View on Github external
)} All files will be Published in https://YOUR_TOKEN@github.com/${
      github.username
    }/${github.repo}.git`
  )
} else {
  remoteURL = `git@github.com:${github.username}/${github.repo}.git`
  console.log(
    `${chalk.blue('info')} All files will be Published in git@github.com:${
      github.username
    }/${github.repo}.git`
  )
}

console.log(`${chalk.blue('info')} Branch: ${github.branch || 'gh-pages'}`)

ghpages.publish(
  path.resolve(__dirname, '../public'),
  {
    branch: github.branch,
    repo: remoteURL,
    message: `:sparkles: Site updated at ${date}`,
    dotfiles: true,
  },
  err => {
    if (err) {
      console.error(err)
      process.exit(1)
    }

    console.log(`${chalk.green('success')} Published.`)
    console.log(
      `${chalk.green('success')} Visit https://github.com/${github.username}/${
github UiPath / angular-components / .build / publish-gh-pages / index.js View on Github external
const ghpages = require('gh-pages')
const { variables } = require('../common')
const { owner, repo, token } = variables;

const PUBLISH_CONFIG = {
    repo: `https://${token}@github.com/${owner}/${repo}.git`,
    silent: true,
}

console.log('Publishing docs to branch `gh-pages`...')

ghpages.publish(
    'documentation',
    PUBLISH_CONFIG,
    (err) => {
        if (err) {
            console.error(err)
        } else {
            console.log('Docs have been published succesfully...')
        }
    })
github jan-molak / serenity-js / gh-pages.js View on Github external
'name of the branch you\'ll be pushing to', 'gh-pages')
    .option('-o, --remote ',
        'The name of the remote', 'origin')
    .option('-m, --message ',
        'commit message', 'Updates')
    .option('-g, --tag ',
        'add tag to commit')
    .option('-t, --dotfiles', 'Include dotfiles')
    .option('-a, --add', 'Only add, and never remove existing files.')
    .option('-v, --remove 

gh-pages

Publish to a gh-pages branch on GitHub (or any other branch on any other remote)

MIT
Latest version published 1 month ago

Package Health Score

86 / 100
Full package analysis

Popular gh-pages functions