Skip to content

Commit 8a3a1bc

Browse files
committed
update package and change the ci to github actions
1 parent 078808b commit 8a3a1bc

File tree

3 files changed

+40
-7
lines changed

3 files changed

+40
-7
lines changed

.github/workflows/main.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: main workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test_deploy:
10+
name: test and deploy Outliner
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Use Node.js 12.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12.x
19+
- name: yarn install and test
20+
run: |
21+
yarn install
22+
yarn jest --coverage -w=2
23+
- name: SonarCloud Trigger
24+
uses: sonarsource/sonarcloud-github-action@master
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
28+
- name: build project
29+
run: |
30+
yarn build
31+
- name: deploy to github pages
32+
uses: JamesIves/github-pages-deploy-action@master
33+
env:
34+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
35+
BRANCH: gh-pages
36+
FOLDER: dist

build/webpack.prod.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require('path')
22
const webpack = require('webpack')
33
const HtmlWebpackPlugin = require('html-webpack-plugin')
4-
const CleanWebpackPlugin = require("clean-webpack-plugin")
4+
const {CleanWebpackPlugin} = require("clean-webpack-plugin")
55
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
66
const BundleAnalyzerPlugin = require(
77
"webpack-bundle-analyzer").BundleAnalyzerPlugin
@@ -78,10 +78,7 @@ module.exports = {
7878
modules: false,
7979
},
8080
plugins: [
81-
new CleanWebpackPlugin(["dist"], {
82-
root: path.resolve(__dirname, "../"),
83-
verbose: true,
84-
}),
81+
new CleanWebpackPlugin(),
8582
new webpack.DefinePlugin({
8683
"process.env.NODE_ENV": JSON.stringify("production"),
8784
}),

sonar-project.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
sonar.host.url=https://sonarcloud.io
2-
#sonar.login=d5dc4bc808334e2350df42804f6d6d5aa9250940
2+
#sonar.login=e9cbb927bedab0008c70acf3639a52574171a704
33
sonar.sourceEncoding=UTF-8
44
sonar.projectKey=Yixi_outliner
55
sonar.projectName=outliner
6-
sonar.organization=yixi-github
6+
sonar.organization=yixi
77
sonar.typescript.lcov.reportPaths=coverage/lcov.info
88
sonar.sources=src/
99
sonar.exclusions=**/node_modules/**,**/*.test.ts,**/*.test.tsx

0 commit comments

Comments
 (0)