ci: improve CI perf by adding dependency caching (#2961)

The `denoland/setup-deno` action recently added built-in caching
(https://github.com/denoland/setup-deno/pull/89,
https://github.com/denoland/setup-deno/pull/98). This makes it a lot
simpler to add caching of the `DENO_DIR` during CI runs, without needing
`@actions/cache` manual setup.

This should speed up CI runs by avoiding downloading dependencies
between every run.
This commit is contained in:
Christian Svensson
2025-05-16 21:28:39 +02:00
committed by GitHub
parent 6ff0becd0a
commit 49737c05c5
3 changed files with 8 additions and 4 deletions
+1
View File
@@ -31,6 +31,7 @@ jobs:
- name: Setup Deno - name: Setup Deno
uses: denoland/setup-deno@v2 uses: denoland/setup-deno@v2
with: with:
cache: true
deno-version: ${{ matrix.deno }} deno-version: ${{ matrix.deno }}
- name: Verify formatting - name: Verify formatting
+5 -4
View File
@@ -3,7 +3,7 @@ on:
push: push:
branches: [main] branches: [main]
pull_request: pull_request:
branches: main branches: [main]
jobs: jobs:
deploy: deploy:
@@ -21,15 +21,16 @@ jobs:
- name: Install Deno - name: Install Deno
uses: denoland/setup-deno@v2 uses: denoland/setup-deno@v2
with: with:
cache: true
deno-version: rc deno-version: rc
- name: Build step - name: Build step
working-directory: ./www working-directory: ./www
run: "deno task build" # 📝 Update the build command(s) if necessary run: "deno task build"
- name: Upload to Deno Deploy - name: Upload to Deno Deploy
uses: denoland/deployctl@v1 uses: denoland/deployctl@v1
with: with:
project: "fresh" # 📝 Update the deploy project name if necessary project: "fresh"
entrypoint: "./www/main.ts" # 📝 Update the entrypoint if necessary entrypoint: "./www/main.ts"
root: "." root: "."
+2
View File
@@ -17,6 +17,8 @@ jobs:
- name: Install Deno - name: Install Deno
uses: denoland/setup-deno@v2 uses: denoland/setup-deno@v2
with:
cache: true
- name: Publish Fresh - name: Publish Fresh
run: deno publish run: deno publish