-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sébastien HOUZÉ
committed
Aug 31, 2021
1 parent
44a86ef
commit 4db8a4c
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
# setup-monorepo-node-app | ||
Prepare everything needed for a Nodejs app in a monorepo (cache, dependencies, ...) | ||
# Setup monorepo node app | ||
|
||
Setup a node app in a monorepo: | ||
1. Sparse checkout the monorepo directory of the Nodejs app | ||
2. Setup Nodejs required version | ||
2. Install dependencies thanks to yarn2 | ||
|
||
## Inputs | ||
|
||
### `node-version` | ||
|
||
**Required** Nodejs version. Default `"14"`. | ||
|
||
### `working-directory` | ||
|
||
**Required** Directory of the node application in the mono repo. Default `"."`. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
- uses: gogaille/setup-monorepo-node-app | ||
with: | ||
node-version: '14' | ||
working-directory: 'some-node-app-dir' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Setup Monorepo node app | ||
description: Prepare everything needed for a Nodejs app in a monorepo (cache, dependencies, ...) | ||
|
||
inputs: | ||
node-version: | ||
description: Nodejs version to use | ||
required: true | ||
default: '14' | ||
working-directory: | ||
description: Directory of the node application in the mono repo | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
run: echo "🤙 Sparse checkout ${{inputs.working-directory}}" | ||
- uses: gogaille/sparse-checkout@v0 | ||
with: | ||
patterns: ${{inputs.working-directory}} | ||
- shell: bash | ||
run: echo "⚙ Setup node version ${{inputs.node-version}}" | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{inputs.node-version}} | ||
- shell: bash | ||
run: echo "📦 Install dependencies" | ||
- shell: bash | ||
name: Install dependencies | ||
run: | | ||
cd ${{inputs.working-directory}} | ||
yarn install --immutable --immutable-cache |