Skip to content

Commit

Permalink
Add cache action to lint workflow (#4517)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Adds caching to `lint` workflow to attempt to reduce bandwidth usage in
Vercel. This also speeds up the workflow checks for Docs PRs as it no
longer needs to wait to install all packages on each run.

Initial run where node mods was cached (Under `Post Cache Node Modules`)

https://github.com/dbt-labs/docs.getdbt.com/actions/runs/6936641309/job/18869155154

2nd run where `lint` workflow detects and uses cache (Under `Cache Node
Modules`)

https://github.com/dbt-labs/docs.getdbt.com/actions/runs/6936659386/job/18869211562

Ensure site is not nuked:
https://docs-getdbt-com-git-cache-node-mods-ci-dbt-labs.vercel.app/
  • Loading branch information
JKarlavige authored Nov 21, 2023
2 parents 893f011 + 5e075bb commit 390f3c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18.12.0'

- name: Cache Node Modules
uses: actions/cache@v3
id: cache-node-mods
with:
path: website/node_modules
key: node-modules-cache-v3-${{ hashFiles('**/package.json', '**/package-lock.json') }}

- name: Install Packages
if: steps.cache-node-mods.outputs.cache-hit != 'true'
run: cd website && npm ci

- name: Run ESLint
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

This file was deleted.

0 comments on commit 390f3c2

Please sign in to comment.