mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改workflow变量
This commit is contained in:
parent
3b3dd4c26d
commit
ee0b47d101
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
|
@ -1,34 +0,0 @@
|
||||||
name: BuildStatic
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '14'
|
|
||||||
|
|
||||||
- name: build front and back
|
|
||||||
run: |
|
|
||||||
yarn install
|
|
||||||
yarn build
|
|
||||||
yarn build-back
|
|
||||||
|
|
||||||
- name: copy to static repo
|
|
||||||
env:
|
|
||||||
# GITHUB_REPO: gitee.com/whyour/qinglong-static
|
|
||||||
GITHUB_REPO: github.com/whyour/qinglong-static
|
|
||||||
run: |
|
|
||||||
mkdir -p static
|
|
||||||
cd ./static
|
|
||||||
cp -rf ../dist ./ && cp -rf ../build ./
|
|
||||||
git init && git add .
|
|
||||||
git config user.name "whyour"
|
|
||||||
git config user.email "imwhyour@gmail.com"
|
|
||||||
git commit --allow-empty -m "copy static at $(date +'%Y-%m-%d %H:%M:%S')"
|
|
||||||
git push --force --quiet "https://whyour:${{ secrets.API_TOKEN }}@${GITHUB_REPO}.git" master:master
|
|
4
.github/workflows/build_docker_image.yml
vendored
4
.github/workflows/build_docker_image.yml
vendored
|
@ -67,8 +67,8 @@ jobs:
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GHCR
|
- name: Login to GHCR
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
|
|
|
@ -18,19 +18,31 @@ export default (app: Router) => {
|
||||||
const fileList = fs.readdirSync(config.scriptPath, 'utf-8');
|
const fileList = fs.readdirSync(config.scriptPath, 'utf-8');
|
||||||
res.send({
|
res.send({
|
||||||
code: 200,
|
code: 200,
|
||||||
data: fileList.map((x) => {
|
data: fileList
|
||||||
|
.map((x) => {
|
||||||
if (fs.lstatSync(config.scriptPath + x).isDirectory()) {
|
if (fs.lstatSync(config.scriptPath + x).isDirectory()) {
|
||||||
const childFileList = fs.readdirSync(
|
const childFileList = fs.readdirSync(
|
||||||
config.scriptPath + x,
|
config.scriptPath + x,
|
||||||
'utf-8',
|
'utf-8',
|
||||||
);
|
);
|
||||||
|
const dirStat = fs.statSync(`${config.scriptPath}${x}`);
|
||||||
return {
|
return {
|
||||||
title: x,
|
title: x,
|
||||||
value: x,
|
value: x,
|
||||||
key: x,
|
key: x,
|
||||||
|
mtime: dirStat.mtimeMs,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
children: childFileList.map((y) => {
|
children: childFileList
|
||||||
const statObj = fs.statSync(`${config.scriptPath}${x}/${y}`);
|
.filter(
|
||||||
|
(y) =>
|
||||||
|
!fs
|
||||||
|
.lstatSync(`${config.scriptPath}${x}/${y}`)
|
||||||
|
.isDirectory(),
|
||||||
|
)
|
||||||
|
.map((y) => {
|
||||||
|
const statObj = fs.statSync(
|
||||||
|
`${config.scriptPath}${x}/${y}`,
|
||||||
|
);
|
||||||
return {
|
return {
|
||||||
title: y,
|
title: y,
|
||||||
value: y,
|
value: y,
|
||||||
|
@ -38,13 +50,15 @@ export default (app: Router) => {
|
||||||
mtime: statObj.mtimeMs,
|
mtime: statObj.mtimeMs,
|
||||||
parent: x,
|
parent: x,
|
||||||
};
|
};
|
||||||
}),
|
})
|
||||||
|
.sort((a, b) => b.mtime - a.mtime),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const statObj = fs.statSync(config.scriptPath + x);
|
const statObj = fs.statSync(config.scriptPath + x);
|
||||||
return { title: x, value: x, key: x, mtime: statObj.mtimeMs };
|
return { title: x, value: x, key: x, mtime: statObj.mtimeMs };
|
||||||
}
|
}
|
||||||
}),
|
})
|
||||||
|
.sort((a, b) => b.mtime - a.mtime),
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('🔥 error: %o', e);
|
logger.error('🔥 error: %o', e);
|
||||||
|
|
|
@ -76,10 +76,8 @@ const Script = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
request
|
request
|
||||||
.get(`${config.apiPrefix}scripts/files`)
|
.get(`${config.apiPrefix}scripts/files`)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const sortData = data.data.sort((a: any, b: any) => b.mtime - a.mtime);
|
setData(data.data);
|
||||||
setData(sortData);
|
setFilterData(data.data);
|
||||||
setFilterData(sortData);
|
|
||||||
onSelect(sortData[0].value, sortData[0]);
|
|
||||||
})
|
})
|
||||||
.finally(() => setLoading(false));
|
.finally(() => setLoading(false));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user