提交 7aa0052c 编写于 作者: Y yangxiaolu3

feat: geng

上级 d9daa4a2
......@@ -15,11 +15,13 @@ jobs:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn copydocs
- name : Deploy
- name : Sync
uses : JamesIves/github-pages-deploy-action@4.1.7
with :
branch : docs_dev # action 应该部署到的分支。
folder : site_docs/docs_vue #操作应该部署的文件夹。
folder : site_docs/docs #操作应该部署的文件夹。
repository-name: jdf2e/nutui-docs
token: ${{ secrets.GIT_ACTION }}
target-folder: src/docs_vue
\ No newline at end of file
target-folder: src/docs_vue/docs
\ No newline at end of file
const vueBaseUrl = `..`;
const targetBaseUrl = 'site_docs';
const fse = require('fs-extra');
const copyFile = (from, to) => {
......@@ -11,10 +10,10 @@ const copyFile = (from, to) => {
console.error(err);
});
};
const copy = async (fromGit, type) => {
const copy = async () => {
let configPath = `src/config.json`;
let configPkgPath = `package.json`;
let nutuiDocsConfigPath = `${targetBaseUrl}/docs_${type}/config.json`;
let nutuiDocsConfigPath = `${targetBaseUrl}/config.json`;
const exists = await fse.pathExists(configPath);
......@@ -44,12 +43,12 @@ const copy = async (fromGit, type) => {
let doctaropath = `src/packages/__VUE/${cmpName}/doc.taro.md`;
fse.readFile(docpath, (err, data) => {
if (!err) {
copyFile(docpath, `${targetBaseUrl}/docs_${type}/docs/${cmpName}/doc.md`);
copyFile(docpath, `${targetBaseUrl}/docs/${cmpName}/doc.md`);
}
});
fse.readFile(doctaropath, (err, data) => {
if (!err) {
copyFile(doctaropath, `${targetBaseUrl}/docs_${type}/docs/${cmpName}/doc.taro.md`);
copyFile(doctaropath, `${targetBaseUrl}/docs/${cmpName}/doc.taro.md`);
}
});
}
......@@ -58,4 +57,4 @@ const copy = async (fromGit, type) => {
}
};
// copy(reactBaseUrl, 'react');
copy(vueBaseUrl, 'vue');
copy();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册