Move website task out of gulp

This commit is contained in:
Alex Dima 2021-11-16 21:51:45 +01:00
parent 240b684846
commit 207f0cf42a
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
11 changed files with 586 additions and 4361 deletions

View file

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
/** @typedef {import('../build/utils').IFile} IFile */
const path = require('path');
const cp = require('child_process');
const { REPO_ROOT } = require('./utils');
cp.execSync('git init', {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
const remoteUrl = cp.execSync('git remote get-url origin');
const committerUserName = cp.execSync("git log --format='%an' -1");
const committerEmail = cp.execSync("git log --format='%ae' -1");
cp.execSync(`git config user.name ${committerUserName}`, {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
cp.execSync(`git config user.email ${committerEmail}`, {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
cp.execSync(`git remote add origin ${remoteUrl}`, {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
cp.execSync('git checkout -b gh-pages', {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
cp.execSync('git add .', {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
cp.execSync('git commit -m "Publish website"', {
cwd: path.join(REPO_ROOT, '../monaco-editor-website')
});
console.log('RUN monaco-editor-website>git push origin gh-pages --force');