🐛(CI) improve caching
When we restored the frontend cache, we were restoring old code as well, we don't want that, we want to only restore the node_modules. This commit fixes that. We improve the build-front caching as well, to cache only the desk build app.
This commit is contained in:
59
.github/workflows/people.yml
vendored
59
.github/workflows/people.yml
vendored
@@ -71,22 +71,22 @@ jobs:
|
|||||||
node-version: '18.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
id: cache-install
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: 'src/frontend/**/node_modules'
|
||||||
key: install-front-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cache-install.outputs.cache-hit != 'true'
|
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
||||||
run: cd src/frontend/ && yarn install --frozen-lockfile
|
run: cd src/frontend/ && yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: Cache install frontend
|
- name: Cache install frontend
|
||||||
if: steps.cache-install.outputs.cache-hit != 'true'
|
if: steps.front-node_modules.outputs.cache-hit != 'true'
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: 'src/frontend/**/node_modules'
|
||||||
key: install-front-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
build-front:
|
build-front:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -96,21 +96,21 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
id: cache-install
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: 'src/frontend/**/node_modules'
|
||||||
key: install-front-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Build CI App
|
- name: Build CI App
|
||||||
run: cd src/frontend/ && yarn ci:build
|
run: cd src/frontend/ && yarn ci:build
|
||||||
|
|
||||||
- name: Cache build frontend
|
- name: Cache build frontend
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: src/frontend/apps/desk/out/
|
||||||
key: build-front-${{ github.run_id }}
|
key: build-front-${{ github.run_id }}
|
||||||
|
|
||||||
test-front:
|
test-front:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: install-front
|
needs: install-front
|
||||||
@@ -119,11 +119,11 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
id: cache-install
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: 'src/frontend/**/node_modules'
|
||||||
key: install-front-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Test App
|
- name: Test App
|
||||||
run: cd src/frontend/ && yarn app:test
|
run: cd src/frontend/ && yarn app:test
|
||||||
@@ -136,11 +136,11 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
id: cache-install
|
id: front-node_modules
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: 'src/frontend/**/node_modules'
|
||||||
key: install-front-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Check linting
|
- name: Check linting
|
||||||
run: cd src/frontend/ && yarn lint
|
run: cd src/frontend/ && yarn lint
|
||||||
@@ -164,11 +164,18 @@ jobs:
|
|||||||
name: mails-templates
|
name: mails-templates
|
||||||
path: src/backend/core/templates/mail
|
path: src/backend/core/templates/mail
|
||||||
|
|
||||||
|
- name: Restore the frontend cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: front-node_modules
|
||||||
|
with:
|
||||||
|
path: 'src/frontend/**/node_modules'
|
||||||
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
|
|
||||||
- name: Restore the build cache
|
- name: Restore the build cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
id: cache-build
|
id: cache-build
|
||||||
with:
|
with:
|
||||||
path: src/frontend/
|
path: src/frontend/apps/desk/out/
|
||||||
key: build-front-${{ github.run_id }}
|
key: build-front-${{ github.run_id }}
|
||||||
|
|
||||||
- name: Build and Start Docker Servers
|
- name: Build and Start Docker Servers
|
||||||
|
|||||||
Reference in New Issue
Block a user