This action allows caching Docusaurus for faster application rebuilds.
Create a workflow .yml
file in your repositories .github/workflows
directory. For more information, reference the GitHub Help Documentation for Creating a workflow file.
This action currently caches the following directories:
.docusaurus
(build output folder)node_modules/.cache
or.yarn/.cache
(In Yarn PnP, cache is stored in.yarn/.cache
because n_m doesn't exist)
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- 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
run: npm run build
Caution
You have to run this action after npm ci
like the above example because npm ci
removes node_modules
first. If you don't, this action will lose its effect.
Check out Contributing guide for ideas on contributing and setup steps for getting our repositories up.
Licensed under the MIT License.