How to use the publish function from gh-pages

Find comprehensive JavaScript gh-pages.publish code examples handpicked from public code repositorys.

1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
  const depOptions = await this.getDepOptions(ciTokenVar, defaultDeployConfig, publish);
  return Site.getDepUrl(depOptions, defaultDeployConfig);
}

/**
 * Helper function for deploy(). Set the options needed to be used by ghpages.publish.
 */
async getDepOptions(ciTokenVar, defaultDeployConfig, publish) {
  const basePath = this.siteConfig.deploy.baseDir || this.outputPath;
  if (!fs.existsSync(basePath)) {
fork icon106
star icon94
watch icon13

+ 4 other calls in file

43
44
45
46
47
48
49
50
51
52
53
    )
}


const ghpagesPublishPromise = (path, config) => {
    return new Promise((resolve, reject) => {
        ghpages.publish(path, config, (err) => {
            if (err) {
                reject(err)
            } else {
                resolve()
fork icon4
star icon5
watch icon2

+ 8 other calls in file

59
60
61
62
63
64
65
66
67
68
69
70
71


var ghpages = require('gh-pages');




gulp.task('pages', function (done) {
    ghpages.publish('gh-pages', {
        branch: 'gh-pages',
        history: false,
        message: `Auto-generated commit. Time - ${new Date().toLocaleString() }`,
        repo: 'https://github.com/sj-net/sj-net.github.io.git'
fork icon0
star icon0
watch icon1

+ 9 other calls in file

378
379
380
381
382
383
384
385
386
387
388
389
  browserSync.reload();
  done();
}


function deploy(cb) {
  ghpages.publish(path.join(process.cwd(), dir.build), cb);
}
exports.deploy = deploy;



fork icon0
star icon0
watch icon1

+ 9 other calls in file