-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: netlify ci demo and docs (#7045)
- Loading branch information
1 parent
e240396
commit 9574bb4
Showing
6 changed files
with
43 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,6 @@ core.es.js | |
|
||
# Ignore Chinese clones for now. | ||
lang/zh-Han*.json | ||
|
||
# netlify deploy | ||
deploy/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,14 @@ | ||
const sh = require('shelljs'); | ||
const semver = require('semver'); | ||
const generateExample = require('./generate-example.js').generateExample; | ||
|
||
const GIT_LOG = `git log --format=%B -n 1 ${process.env.COMMIT_REF}`; | ||
const output = sh.exec(GIT_LOG, {async: false, silent: true}).stdout; | ||
|
||
// if we're on master branch and not on a tagged commit, | ||
// if we're on main branch and not on a tagged commit, | ||
// error the build so it doesn't redeploy the docs | ||
if (process.env.BRANCH === 'master' && semver.valid(output.trim()) === null) { | ||
if (process.env.BRANCH === 'main' && semver.valid(output.trim()) === null) { | ||
process.exit(1); | ||
|
||
// if we're on any other branch, we can regenerate docs | ||
} else { | ||
if (process.env.BRANCH !== 'master') { | ||
// generate the example | ||
generateExample(); | ||
} | ||
|
||
// generate the docs | ||
sh.exec('npm run docs:api'); | ||
|
||
// copy the legacy docs over | ||
sh.cp('-R', 'docs/legacy-docs', 'docs/api/docs'); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const pkg = require('../package.json'); | ||
const path = require('path'); | ||
const sh = require('shelljs'); | ||
|
||
process.env.CI = true; | ||
// run build steps | ||
sh.exec('npm run build'); | ||
sh.exec('npm run sandbox'); | ||
sh.exec('npm run docs:api'); | ||
|
||
// copy the legacy docs over | ||
sh.cp('-R', 'docs/legacy-docs', 'docs/api/docs'); | ||
|
||
const deployDir = 'deploy'; | ||
const files = [ | ||
'node_modules/es5-shim/es5-shim.js', | ||
'node_modules/es6-shim/es6-shim.js' | ||
]; | ||
|
||
// cleanup previous deploy | ||
sh.rm('-rf', deployDir); | ||
// make sure the directory exists | ||
sh.mkdir('-p', deployDir); | ||
|
||
// create nested directories | ||
files | ||
.map((file) => path.dirname(file)) | ||
.forEach((dir) => sh.mkdir('-p', path.join(deployDir, dir))); | ||
|
||
// copy files/folders to deploy dir | ||
files | ||
.concat('dist', 'index.html', 'sandbox', 'docs') | ||
.forEach((file) => sh.cp('-r', file, path.join(deployDir, file))); | ||
|
||
sh.rm(path.join(deployDir, 'dist', `video-js-${pkg.version}.zip`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters