diff --git a/actions/dependencies-cache/README.md b/actions/dependencies-cache/README.md index 7459ff0..8e1d87d 100644 --- a/actions/dependencies-cache/README.md +++ b/actions/dependencies-cache/README.md @@ -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`) + diff --git a/actions/dependencies-cache/action.yml b/actions/dependencies-cache/action.yml index b2f4a0a..93b1dcb 100644 --- a/actions/dependencies-cache/action.yml +++ b/actions/dependencies-cache/action.yml @@ -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 @@ -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 diff --git a/actions/has-installed-dependencies/action.yml b/actions/has-installed-dependencies/action.yml index 837b078..94eba48 100644 --- a/actions/has-installed-dependencies/action.yml +++ b/actions/has-installed-dependencies/action.yml @@ -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 !== '');