How to use gh-pages - 10 common examples

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 algolia / docsearch / scripts / docs / gh-pages.js View on Github external
/* eslint no-console:0 */
import ghpages from 'gh-pages';
import {join} from 'path';

let basePath = join(__dirname, '../../docs/build');

ghpages.clean();

if (process.env.CI === 'true') {
  ghpages.publish(basePath, {
    repo: 'https://' + process.env.GH_TOKEN + '@github.com/algolia/docsearch.git'
  }, end);
} else {
  ghpages.publish(basePath, end);
}

function end(err) {
  if (err) {
    throw err;
  } else {
    console.log('published gh-pages');
  }
}
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 angular-schule / angular-cli-ghpages / src / engine / engine.ts View on Github external
export async function run(
  dir: string,
  options: Schema,
  logger: logging.LoggerApi
) {
  options = prepareOptions(options, logger);

  // this has to occur _after_ the monkeypatch of util.debuglog:
  const ghpages = require('gh-pages');

  // always clean the cache directory.
  // avoids "Error: Remote url mismatch."
  if (options.dryRun) {
    logger.info('Dry-run / SKIPPED: cleaning of the cache directory');
  } else {
    ghpages.clean();
  }

  await checkIfDistFolderExists(dir);
  await createNotFoundPage(dir, options, logger);
  await createCnameFile(dir, options, logger);
  await publishViaGhPages(ghpages, dir, options, logger);

  logger.info(
    '🚀 Successfully published via angular-cli-ghpages! Have a nice day!'
  );
}
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}/${

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

89 / 100
Full package analysis

Popular gh-pages functions