From 462f4df219808f0e934fb8328389e11d6d380048 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 3 Jan 2025 23:37:27 +1100 Subject: [PATCH] Cache page assets during CI/CD --- .gitea/workflows/build_docker.yaml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build_docker.yaml b/.gitea/workflows/build_docker.yaml index 04eba39..3b8c3ca 100644 --- a/.gitea/workflows/build_docker.yaml +++ b/.gitea/workflows/build_docker.yaml @@ -37,6 +37,7 @@ jobs: # Build assets npm i npm run prod + ls -al public/css/app.css # - name: Run Tests # run: | @@ -63,10 +64,7 @@ jobs: key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- build: strategy: @@ -114,9 +112,22 @@ jobs: - name: Code Checkout uses: actions/checkout@v4 + - 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 node modules - continue-on-error: true + name: List the state of page assets + continue-on-error: false run: | ls -al ls -al public/css/