Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions actions/dependencies-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@

Action to setup dependencies cache managment.

### Supported caches

- NX (`node_modules/.cache/nx`)
- Prettier (`node_modules/.cache/prettier`)
- Docusaurus (`.docusaurus`, `node_modules/.cache/webpack`)
- Astro (`node_modules/.astro`)
- Gatsby (`.cache`, `public`)
- Storybook (`node_modules/.cache/storybook`)
- Jest (auto-detected `cacheDirectory`)

<!-- overview:end -->

<!-- usage:start -->
Expand Down
34 changes: 33 additions & 1 deletion actions/dependencies-cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
name: "Dependencies cache"
description: "Action to setup dependencies cache managment."
description: |
Action to setup dependencies cache managment.

### Supported caches

- NX (`node_modules/.cache/nx`)
- Prettier (`node_modules/.cache/prettier`)
- Docusaurus (`.docusaurus`, `node_modules/.cache/webpack`)
- Astro (`node_modules/.astro`)
- Gatsby (`.cache`, `public`)
- Storybook (`node_modules/.cache/storybook`)
- Jest (auto-detected `cacheDirectory`)

author: hoverkraft
branding:
icon: archive
Expand Down Expand Up @@ -54,6 +66,26 @@ runs:
restore-keys: |
${{ runner.os }}-cache-prettier-

- name: ♻️ Docusaurus cache
if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).docusaurus == true
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
${{ inputs.working-directory }}/.docusaurus
${{ inputs.working-directory }}/node_modules/.cache/webpack
key: ${{ runner.os }}-cache-docusaurus-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cache-docusaurus-

- name: ♻️ Astro cache
if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).astro == true
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ inputs.working-directory }}/node_modules/.astro
key: ${{ runner.os }}-cache-astro-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cache-astro-

- name: ♻️ Gatsby cache
if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).gatsby == true
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
Expand Down
5 changes: 3 additions & 2 deletions actions/has-installed-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ runs:
process.chdir(workingDirectory);
const dependenciesPatterns = {
storybook: /@storybook\/[-a-z]+/,
nx: /@nx\/[-a-z]+/,
storybook: /@storybook\/[a-z0-9\-]+/,
nx: /@nx\/[a-z0-9\-]+/,
docusaurus: /@docusaurus\/[a-z0-9\-]+/,
};
const dependencies = `${{ inputs.dependencies }}`.split('\n').map(x => x.trim()).filter(x => x !== '');
Expand Down
Loading