Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updates, move to ESNext/ESModule with TS-ESNode #3

Open
wants to merge 1 commit into
base: alternative
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "NPM Action Container",
"dockerFile": "./Dockerfile.dev",
"settings": {
// This dev container does include /bin/bash if you prefer to use it instead of ash.
"terminal.integrated.shell.linux": "/bin/sh"
},

"remoteEnv": {
"SHELL": "/bin/sh"
},

"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"],
"remoteUser": "node",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"mounts": [
"source=npm-run-modules,target=/workspace/node_modules,type=volume"
],
"postCreateCommand": "sudo chown node node_modules && npm i"
}
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"semi": true
}
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM mhart/alpine-node:12
FROM node:alpine3.11
WORKDIR /app

COPY src ./src/
COPY package.json package-lock.json tsconfig.json ./
RUN npm install
RUN NODE_ENV=production npm run build
ENTRYPOINT ["node", "/app/lib/index.js"]

RUN npm ci

ENTRYPOINT ["npm", "start"]
9 changes: 9 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:alpine3.11
RUN apk add --no-cache git python3

# Add Sudo to allow occasional usage of root. I wish I could remove this but I can't seem to get the node_modules volume working correctly.
RUN apk add --no-cache sudo \
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node

CMD [ "tail", "-f", "/dev/null" ]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# K-FOSS/npm-run-action

This is a GitHub action for running NPM scripts.

## Usage

Under the steps field in your Action YAML

```YAML
- uses: K-FOSS/npm-run-action
with:
scriptName: 'test'
scriptPath: 'API/'

```
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
description: 'NPM Script to run'
required: true
default: 'test'
scriptPath:
description: 'Path to `package.json`'
required: true
default: './'
runs:
using: 'docker'
image: 'Dockerfile'
image: 'Dockerfile'
Loading