Skip to content

Commit

Permalink
fix(packages): install packages globally to faciliate "extends" configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Oct 30, 2020
1 parent 6eefc5b commit 709de21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ WORKDIR /action

COPY action ./

RUN npm ci --only=prod
# install packages globally
RUN node /action/install.js

# also install globally
RUN npm i --global --only=prod
# install locally
RUN npm ci --only=prod

ENTRYPOINT ["node", "/action/index.js"]
6 changes: 6 additions & 0 deletions action/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { dependencies } = require('./package.json')
const { spawn } = require('child_process')

for (const [dependency, version] of Object.entries(dependencies)) {
spawn('npm', ['install', '--global', `${dependency}@${version}`], { stdio: 'inherit' })
}

0 comments on commit 709de21

Please sign in to comment.