Skip to content
play

GitHub Action

Monorepo Cache Key

v1 Latest version

Monorepo Cache Key

play

Monorepo Cache Key

outputs a cache key for your monorepo node_modules

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Monorepo Cache Key

uses: flaviouk/monorepo-cache-key@v1

Learn more about this action in flaviouk/monorepo-cache-key

Choose a version

monorepo-cache-key

- uses: actions/checkout@v2

- name: Get Cache Key
  uses: flaviouk/monorepo-cache-key@v1
  id: cache-key
  with:
    cache-prefix: foo-bar # This could be {os}-{node-version} for example

- name: Print Cache Key
  run: echo ${{ steps.cache-key.outputs.cacheKey }}

Publish to a distribution branch

Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run ncc and push the results:

$ npm run package
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1

Usage:

After testing you can create a v1 tag to reference the stable and latest V1 action