Skip to content

Commit

Permalink
Added docker build step
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav Dhasmana committed Aug 23, 2019
1 parent 053f6d8 commit 00ddc2f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
@@ -0,0 +1 @@
node_modules
23 changes: 16 additions & 7 deletions .github/main.workflow
Expand Up @@ -2,24 +2,33 @@ workflow "npm build, lint, test and publish" {
on = "push"

resolves = [
"lint",
"test"
"docker build"
]
}

action "build" {
action "npm install" {
uses = "actions/npm@master"
args = "install"
}

action "lint" {
needs = "build"
action "npm lint" {
needs = "npm install"
uses = "actions/npm@master"
args = "run lint"
}

action "test" {
needs = "build"
action "npm test" {
needs = "npm install"
uses = "actions/npm@master"
args = "run test"
}

action "docker build" {
uses = "actions/docker/cli@master"
args = "build -t abhinavdhasmana/github-action-example-node ."

needs = [
"npm lint",
"npm test"
]
}
12 changes: 12 additions & 0 deletions Dockerfile
@@ -0,0 +1,12 @@
FROM node:10.16.0-alpine

WORKDIR /source/github-action-example-node

COPY package.json /source/github-action-example-node

RUN cd /source/github-action-example-node && npm i --only=production

COPY . .

EXPOSE 3000
CMD ["sh", "-c", "node server.js"]

0 comments on commit 00ddc2f

Please sign in to comment.