From 004b772b5c66e4bb92fc2b2c8681190ba78e705f Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 18 Feb 2024 21:44:42 +0100 Subject: [PATCH] [RELEASE] cache node_modules --- .dockerignore | 1 - .forgejo/workflows/build-release.yml | 12 ++++++++++++ Dockerfile | 2 +- Dockerfile.rootless | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 80cbeb040c..d1a08977a5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -71,7 +71,6 @@ cpu.out /tests/e2e/test-artifacts /tests/e2e/test-snapshots /tests/*.ini -/node_modules /yarn.lock /yarn-error.log /npm-debug.log* diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index bb37128fbc..8eac55e561 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -82,6 +82,18 @@ jobs: ENDVAR EOF + - name: cache node_modules + id: node + uses: https://code.forgejo.org/actions/cache@v3 + with: + path: | + node_modules + key: node-${{ steps.release-info.outputs.version }} + + - name: skip if node cache hit + if: steps.node.outputs.cache-hit != 'true' + run: echo no hit + - name: Build sources run: | set -x diff --git a/Dockerfile b/Dockerfile index 81a34d5d23..c7c15c0b52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ RUN apk --no-cache add build-base git nodejs npm COPY . ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -RUN make clean-all +RUN make clean RUN make frontend RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini RUN make RELEASE_VERSION=$RELEASE_VERSION go-check generate-backend static-executable && xx-verify gitea diff --git a/Dockerfile.rootless b/Dockerfile.rootless index 83b19f4dcc..bf3c92bbc5 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -33,7 +33,7 @@ RUN apk --no-cache add build-base git nodejs npm COPY . ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -RUN make clean-all +RUN make clean RUN make frontend RUN go build contrib/environment-to-ini/environment-to-ini.go && xx-verify environment-to-ini RUN make RELEASE_VERSION=$RELEASE_VERSION go-check generate-backend static-executable && xx-verify gitea