diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..0c61b28 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,29 @@ +name: Deploy dev build + +on: push + +jobs: + deploy-dev: + runs-on: ubuntu-latest + container: node:15 + + steps: + - name: Check out repository code + uses: actions/checkout@v2 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run full-build + + - name: Deploy to dev server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.DEV_DEPLOY_HOST }} + username: ${{ secrets.DEV_DEPLOY_USER }} + key: ${{ secrets.DEV_DEPLOY_KEY }} + port: ${{ secrets.DEV_DEPLOY_PORT }} + source: "build" + target: ${{ secrets.DEV_DEPLOY_ROOT }} + rm: true diff --git a/.gitignore b/.gitignore index 8573590..254633f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ yarn-error.log* /src/__data__/host.json + +/deploy*.sh diff --git a/package.json b/package.json index 4edc3db..013dd7e 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,10 @@ }, "scripts": { "start": "craco start", + "clean": "rimraf build", "build": "craco build", "optimise": "gzip -kr build/static", - "full-build": "npm run build; npm run optimise", + "full-build": "npm run clean; GENERATE_SOURCEMAP=false npm run build; npm run optimise", "test": "craco test" }, "eslintConfig": { @@ -93,6 +94,7 @@ "react-refresh": "^0.9.0", "react-scripts": "4.0.2", "redux-devtools-extension": "^2.13.8", + "rimraf": "^3.0.2", "typescript": "^4.1.5", "utility-types": "^3.10.0", "webpack-bundle-analyzer": "^4.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e34048c..4f42bdb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,6 +54,7 @@ react-refresh: 0.9.0 react-scripts: 4.0.2_react@17.0.1+typescript@4.1.5 redux-devtools-extension: 2.13.8_redux@4.0.5 + rimraf: 3.0.2 typescript: 4.1.5 utility-types: 3.10.0 webpack-bundle-analyzer: 4.4.0 @@ -13588,6 +13589,7 @@ react-world-flags: ^1.4.0 redux: ^4.0.5 redux-devtools-extension: ^2.13.8 + rimraf: ^3.0.2 semver: ^7.3.4 spu-md5: 0.0.4 typesafe-actions: ^5.1.0 diff --git a/src/index.tsx b/src/index.tsx index a143e4f..7dc949a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,7 +6,7 @@ import "./index.css"; import App from "./App"; -import reportWebVitals from "./reportWebVitals"; +// import reportWebVitals from "./reportWebVitals"; ReactDOM.render( // @@ -18,4 +18,4 @@ // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); +// reportWebVitals();