This GitHub Action installs mono-repository dependencies using PNPM. It's designed to efficiently handle dependencies in a mono-repository setup, enabling corepack
support and caching node modules to speed up builds.
This action is ideal for projects that require optimal dependency management and fast execution of workflows within CI environments.
Create a new workflow file, for example, .github/workflows/build.yml
, and add the following code to it.
---
on:
push:
branches:
- master
pull_request:
name: 🔍 Continuous integration for web app
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4
# ...
- name: ⚙️ Setup PNPM mono-repository
uses: wayofdev/gh-actions/actions/pnpm/install@master
with:
cwd: '.'
enable-corepack: true
cache-prefix: 'ci-build'
cache-node-modules: true
# ...
...
For details, see actions/pnpm/install/action.yml
.
Real-world examples can be found in the wayofdev/next-starter-tpl
repository.
cwd
, optional: Changes Node's process current working directory. Defaults to the root directory (.
).enable-corepack
, optional: Enablescorepack
to manage package installations. Defaults tofalse
.cache-prefix
, optional: Specifies a custom prefix for caching mechanisms. Defaults todefault
.cache-node-modules
, optional: Enables caching ofnode_modules
directories. Defaults tofalse
.
none
- Enabling
corepack
sets up the package manager environment using the system's corepack feature. - PNPM is installed or configured according to the presence of
corepack
. - Caching keys are created and used for faster retrieval of the
node_modules
and pnpm store directories. - Dependencies are installed with options such as
--no-frozen-lockfile
,--strict-peer-dependencies
, and--prefer-offline
to ensure consistency and reproducibility across installations.