From e17b7290c6452b16f535af6345de6c8490ebc730 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 28 Nov 2023 19:07:31 +0100 Subject: [PATCH] fix caching in workflow --- .github/workflows/deploy.yml | 9 ++++++++- Makefile | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c4a4842..0fd2898 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,8 +19,15 @@ jobs: - name: restore libavjs cache uses: actions/cache@v3 with: - key: libavjs-files--${{ hashFiles('libavjs/*') }} + key: libavjs-files--${{ hashFiles('libav.js/*') }} path: public/app/bundled/libavjs/ + - name: update cache timestamps + # this will update the timestamps on the cache + # this is necessary since the Dockerfile will always be newer (gets + # checkout timestamp). + # However because of the hash, cache only gets restored if the Dockerfile + # is unchanged. + run: make -t public/app/bundled/libavjs/empty && true - name: install packages run: npm install . - name: Build diff --git a/Makefile b/Makefile index 9513212..40b78b1 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ $(LIBAVJS_TARGET_FILES): libav.js/Dockerfile --build-arg="FILES_TO_BUILD=$(LIBAVJS_MAKE_FILES)" \ --target=artifact --output type=local,dest=$(OUTDIR) @mkdir -p public/app/bundled/libavjs - @cp -Rv $(OUTDIR)/dist public/app/bundled/libavjs + @cp -R $(OUTDIR)/dist public/app/bundled/libavjs public/app/tsc: tsconfig.json $(shell find src) public/app/bundled/libavjs/empty @tsc --noEmit