From b1d0f639988f5ce8ed913020aac06c63de0b5054 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 15 Jun 2024 05:16:46 +0000 Subject: [PATCH] Make CI faster with docusaurus cache actions (#5) Reviewed-on: https://gitea.com/gitea/docs/pulls/5 --- .gitea/workflows/test.yaml | 11 +++++++++++ Makefile | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index 17f5514f..55acbca8 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -15,6 +15,17 @@ jobs: - name: prepare awesome list run: | make prepare-awesome-latest prepare-awesome\#22 prepare-awesome\#21 prepare-awesome\#20 prepare-awesome\#19 + - name: Cache ~/.npm for npm ci + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node + + - name: Install dependencies + run: npm ci + + - uses: docuactions/cache@v1 - name: build site run: | make build diff --git a/Makefile b/Makefile index 8f418594..dd201246 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,6 @@ prepare-docs: install prepare-awesome-latest prepare-awesome\#19 prepare-awesome .PHONY: build build: - npm ci npm run build .PHONY: serve