Cache page assets during CI/CD
Some checks failed
Create Docker Image / Test Application (x86_64) (push) Successful in 3m42s
Create Docker Image / Final Docker Image Manifest (push) Has been cancelled
Create Docker Image / Build Docker Image (arm64) (push) Has been cancelled
Create Docker Image / Build Docker Image (x86_64) (push) Has been cancelled

This commit is contained in:
Deon George 2025-01-04 17:57:35 +11:00
parent 73c38a7ee6
commit ffc18b13fb

View File

@ -55,17 +55,17 @@ jobs:
- name: Cache page assets
id: cache-page-assets
uses: actions/cache@v3
env:
cache-name: page-assets
# env:
# cache-name: page-assets
with:
path: |
public/css/app.css
public/js/app.js
public/js/vendor.js
key:
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
#key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: build-pla-page-assets-${{ hashFiles('**/package-lock.json') }}
#restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
build:
strategy:
@ -113,25 +113,28 @@ jobs:
- name: Code Checkout
uses: actions/checkout@v4
# - name: Cache page assets
# id: cache-page-assets
# uses: actions/cache@v3
- name: Cache page assets
id: cache-page-assets
uses: actions/cache@v3
# env:
# cache-name: page-assets
# with:
# path: |
# public/css/app.css
# key:
# ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
#
# - if: ${{ steps.cache-page-assets.outputs.cache-hit != 'true' }}
# name: List the state of page assets
# continue-on-error: false
# run: |
# ls -al public/css/
# ls -al public/js/
with:
path: |
public/css/app.css
public/js/app.js
public/js/vendor.js
#key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: build-pla-page-assets-${{ hashFiles('**/package-lock.json') }}
#restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-page-assets.outputs.cache-hit != 'true' }}
name: List the state of page assets
continue-on-error: false
run: |
echo CACHE-HIT:${{ steps.cache-page-assets.outputs.cache-hit }}
ls -al public/css/
ls -al public/js/
- name: Record version and Delete Unnecessary files
run: |