From fbb0d3acedea60f0200fa9977a430e7f9224b064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Schr=C3=B6ter?= Date: Fri, 4 Oct 2024 13:23:24 +0200 Subject: [PATCH] Add GitHub Actions workflow for caching npm dependencies and building and pushing Docker images --- .github/workflows/docker-build-and-push.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 8dcaf01..e516bc4 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -33,6 +33,14 @@ jobs: with: node-version: 20 + - name: Cache npm dependencies + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install frontend dependencies run: npm install working-directory: web-app @@ -67,6 +75,8 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} + cache-from: type=gha + cache-to: type=gha,mode=max tags: | icereed/paperless-gpt:unreleased ${{ github.ref == 'refs/heads/main' && 'icereed/paperless-gpt:unreleased' }}