Yuki Takei 3 лет назад
Родитель
Сommit
3ecd3abd16
3 измененных файлов с 77 добавлено и 32 удалено
  1. 40 22
      .github/workflows/ci-app.yml
  2. 35 10
      .github/workflows/ci-slackbot-proxy.yml
  3. 2 0
      .github/workflows/reusable-app-prod.yml

+ 40 - 22
.github/workflows/ci-app.yml

@@ -54,15 +54,15 @@ jobs:
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
-      - name: Cache/Restore dist
-        uses: actions/cache@v3
+      - name: Restore dist
+        uses: actions/cache/restore@v3
         with:
         with:
           path: |
           path: |
             **/.turbo
             **/.turbo
             **/dist
             **/dist
-          key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+          key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
           restore-keys: |
           restore-keys: |
-            dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
+            dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
       - name: Install dependencies
       - name: Install dependencies
         run: |
         run: |
@@ -83,6 +83,15 @@ jobs:
           isCompactMode: true
           isCompactMode: true
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
 
+      - name: Cache dist
+        uses: actions/cache/save@v3
+        with:
+          path: |
+            **/.turbo
+            **/dist
+          key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+
+
   test:
   test:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
@@ -116,15 +125,15 @@ jobs:
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
-      - name: Cache/Restore dist
-        uses: actions/cache@v3
+      - name: Restore dist
+        uses: actions/cache/restore@v3
         with:
         with:
           path: |
           path: |
             **/.turbo
             **/.turbo
             **/dist
             **/dist
-          key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+          key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
           restore-keys: |
           restore-keys: |
-            dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
+            dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
       - name: Install dependencies
       - name: Install dependencies
         run: |
         run: |
@@ -155,6 +164,15 @@ jobs:
           isCompactMode: true
           isCompactMode: true
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
 
+      - name: Cache dist
+        uses: actions/cache/save@v3
+        with:
+          path: |
+            **/.turbo
+            **/dist
+          key: dist-app-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+
+
   launch-dev:
   launch-dev:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
@@ -188,25 +206,16 @@ jobs:
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
             node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
-      - name: Cache/Restore dist
-        uses: actions/cache@v3
+      - name: Restore dist
+        uses: actions/cache/restore@v3
         with:
         with:
           path: |
           path: |
             **/.turbo
             **/.turbo
             **/dist
             **/dist
-          key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
-          restore-keys: |
-            dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
-
-      - name: Cache/Restore next cache files
-        uses: actions/cache@v3
-        with:
-          path: |
-            ${{ github.workspace }}/apps/app/.next/cache
-          key: dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/app/package.json') }}
+            ${{ github.workspace }}/apps/app/.next
+          key: dist-app-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
           restore-keys: |
           restore-keys: |
-            dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
-            dev-${{ runner.OS }}-node${{ matrix.node-version }}-
+            dist-app-dev-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
       - name: Install dependencies
       - name: Install dependencies
         run: |
         run: |
@@ -230,3 +239,12 @@ jobs:
           channel: '#ci'
           channel: '#ci'
           isCompactMode: true
           isCompactMode: true
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
           url: ${{ secrets.SLACK_WEBHOOK_URL }}
+
+      - name: Cache dist
+        uses: actions/cache/save@v3
+        with:
+          path: |
+            **/.turbo
+            **/dist
+            ${{ github.workspace }}/apps/app/.next
+          key: dist-app-dev-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}

+ 35 - 10
.github/workflows/ci-slackbot-proxy.yml

@@ -49,15 +49,15 @@ jobs:
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
-    - name: Cache/Restore dist
-      uses: actions/cache@v3
+    - name: Restore dist
+      uses: actions/cache/restore@v3
       with:
       with:
         path: |
         path: |
           **/.turbo
           **/.turbo
           **/dist
           **/dist
-        key: dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+        key: dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
         restore-keys: |
         restore-keys: |
-          dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-
+          dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
     - name: Install dependencies
     - name: Install dependencies
       run: |
       run: |
@@ -78,6 +78,15 @@ jobs:
         isCompactMode: true
         isCompactMode: true
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
 
+    - name: Cache dist
+      uses: actions/cache/save@v3
+      with:
+        path: |
+          **/.turbo
+          **/dist
+        key: dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+
+
   launch-dev:
   launch-dev:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
@@ -114,15 +123,15 @@ jobs:
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
           node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
-    - name: Cache/Restore dist
-      uses: actions/cache@v3
+    - name: Restore dist
+      uses: actions/cache/restore@v3
       with:
       with:
         path: |
         path: |
           **/.turbo
           **/.turbo
           **/dist
           **/dist
-        key: dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+        key: dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
         restore-keys: |
         restore-keys: |
-          dist-ci-slackbot-proxy-${{ runner.OS }}-node${{ matrix.node-version }}-
+          dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-
 
 
     - name: Install dependencies
     - name: Install dependencies
       run: |
       run: |
@@ -153,6 +162,14 @@ jobs:
         isCompactMode: true
         isCompactMode: true
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
 
 
+    - name: Cache dist
+      uses: actions/cache/save@v3
+      with:
+        path: |
+          **/.turbo
+          **/dist
+        key: dist-slackbot-proxy-ci-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
+
 
 
   launch-prod:
   launch-prod:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
@@ -204,8 +221,8 @@ jobs:
       run: |
       run: |
         yarn --frozen-lockfile
         yarn --frozen-lockfile
 
 
-    - name: Cache/Restore dist
-      uses: actions/cache@v3
+    - name: Restore dist
+      uses: actions/cache/restore@v3
       with:
       with:
         path: |
         path: |
           **/.turbo
           **/.turbo
@@ -246,3 +263,11 @@ jobs:
         channel: '#ci'
         channel: '#ci'
         isCompactMode: true
         isCompactMode: true
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
         url: ${{ secrets.SLACK_WEBHOOK_URL }}
+
+    - name: Restore dist
+      uses: actions/cache/save@v3
+      with:
+        path: |
+          **/.turbo
+          **/dist
+        key: dist-slackbot-proxy-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}

+ 2 - 0
.github/workflows/reusable-app-prod.yml

@@ -64,6 +64,7 @@ jobs:
         path: |
         path: |
           **/.turbo
           **/.turbo
           **/dist
           **/dist
+          ${{ github.workspace }}/apps/app/.next
         key: dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
         key: dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
         restore-keys: |
         restore-keys: |
           dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-
           dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-
@@ -122,6 +123,7 @@ jobs:
         path: |
         path: |
           **/.turbo
           **/.turbo
           **/dist
           **/dist
+          ${{ github.workspace }}/apps/app/.next
         key: dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}
         key: dist-app-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }}