Ver código fonte

🚀 Deploy: add deploy ci

chenshuai2144 5 anos atrás
pai
commit
57c4aad73b
3 arquivos alterados com 30 adições e 14 exclusões
  1. 0 14
      .github/workflows/ci.yml
  2. 22 0
      .github/workflows/deploy.yml
  3. 8 0
      config/config.ts

+ 0 - 14
.github/workflows/ci.yml

@@ -25,17 +25,3 @@ jobs:
           PROGRESS: none
           NODE_ENV: test
           NODE_OPTIONS: --max_old_space_size=4096
-  build-and-deploy:
-    runs-on: ubuntu-latest
-    if: github.event == 'push' && github.ref == 'master'
-    steps:
-      - name: Checkout
-        uses: actions/checkout@master
-
-      - name: Build and Deploy
-        uses: JamesIves/github-pages-deploy-action@master
-        env:
-          GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
-          BRANCH: gh-pages
-          FOLDER: 'dist/'
-          BUILD_SCRIPT: npm install && npm run deploy

+ 22 - 0
.github/workflows/deploy.yml

@@ -0,0 +1,22 @@
+name: Deploy CI
+
+on: [push]
+
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    if: github.event == 'push' && github.ref == 'master'
+    steps:
+      - name: Checkout
+        uses: actions/checkout@master
+      - run: yarn
+      - run: yarn run lint
+      - run: yarn run tsc
+      - name: Build and Deploy
+        uses: JamesIves/github-pages-deploy-action@master
+        env:
+          ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: site
+          GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
+          BRANCH: gh-pages
+          FOLDER: 'dist/'
+          BUILD_SCRIPT: yarn && npm run deploy

+ 8 - 0
config/config.ts

@@ -69,6 +69,14 @@ if (isAntDesignProPreview) {
       code: 'UA-72788897-6',
     },
   ]);
+
+  plugins.push([
+    'umi-plugin-pro',
+    {
+      serverUrl: 'https://ant-design-pro.netlify.com',
+    },
+  ]);
+
   plugins.push(['umi-plugin-antd-theme', themePluginConfig]);
 }