Skip to content

Commit

Permalink
Add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien HOUZÉ committed Aug 31, 2021
1 parent 44a86ef commit 4db8a4c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
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'
```
32 changes: 32 additions & 0 deletions action.yaml
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

0 comments on commit 4db8a4c

Please sign in to comment.