Yuki Takei 4 лет назад
Родитель
Сommit
de138e5909
1 измененных файлов с 49 добавлено и 6 удалено
  1. 49 6
      .github/workflows/ci.yml

+ 49 - 6
.github/workflows/ci.yml

@@ -52,6 +52,52 @@ jobs:
         isCompactMode: true
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
+  install-prod-node14:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - uses: actions/setup-node@v2
+      with:
+        node-version: 14.x
+        cache: 'yarn'
+        cache-dependency-path: '**/yarn.lock'
+
+    - name: Cache/Restore node_modules
+      id: cache-dependencies
+      uses: actions/cache@v2
+      with:
+        path: |
+          **/node_modules
+        key: ${{ runner.OS }}-node_modules-14.x-prod-${{ hashFiles('**/yarn.lock') }}
+        restore-keys: |
+          ${{ runner.os }}-node_modules-14.x-prod-
+          ${{ runner.os }}-node_modules-14.x-
+
+    - name: Remove unnecessary packages
+      run: |
+        rm -rf packages/slackbot-proxy
+    - name: lerna bootstrap --production
+      run: |
+        npx lerna bootstrap -- --production
+
+    - name: Print dependencies
+      run: |
+        echo -n "node " && node -v
+        echo -n "npm " && npm -v
+        yarn list --depth=0
+
+    - name: Slack Notification
+      uses: weseek/ghaction-slack-notification@master
+      if: failure()
+      with:
+        type: ${{ job.status }}
+        job_name: '*Node CI for growi - install-prod-node14*'
+        channel: '#ci'
+        isCompactMode: true
+        url: ${{ secrets.SLACK_WEBHOOK_URL }}
+
   lint:
     needs: install-node14
 
@@ -278,7 +324,7 @@ jobs:
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
   launch-prod:
-    needs: build-prod
+    needs: [install-prod-node14, build-prod]
 
     runs-on: ubuntu-latest
 
@@ -307,16 +353,13 @@ jobs:
       with:
         path: |
           **/node_modules
-        key: ${{ runner.OS }}-node_modules-14.x-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-14.x-prod-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
-          ${{ runner.os }}-node_modules-14.x-
+          ${{ runner.os }}-node_modules-14.x-prod-
 
     - name: Remove unnecessary packages
       run: |
         rm -rf packages/slackbot-proxy
-    - name: lerna bootstrap --production
-      run: |
-        npx lerna bootstrap -- --production
 
     - name: Download built artifact
       uses: actions/download-artifact@v2