Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Commit e0e6db4

Browse files
- NODE_PATH is fixed in docker build
- Publish CI is optimised
1 parent d537b05 commit e0e6db4

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
name: CI
1+
name: Build and Publish on release published
22

3-
on: [push]
3+
on:
4+
release:
5+
types: [published]
46

57
jobs:
6-
78
build:
8-
9+
910
runs-on: ubuntu-latest
11+
1012
steps:
11-
- uses: actions/checkout@v2
12-
13-
- name: Run Docker build
14-
run: docker build .
15-
16-
- name: Publish Docker
17-
uses: elgohr/[email protected]
18-
with:
19-
name: midhub/docker-nodejs/docker-nodejs-crypto
20-
username: $GITHUB_ACTOR
21-
password: ${{ secrets.GITHUB_TOKEN }}
22-
registry: docker.pkg.github.com
13+
- uses: actions/checkout@v2
14+
- name: Get the version
15+
id: get_version
16+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
17+
- name: Publish Docker
18+
uses: elgohr/[email protected]
19+
with:
20+
name: midhub/nodejs-crypto
21+
username: vetermanve
22+
password: ${{secrets.DOCKER_AUTH_TOKEN}}
23+
tags: "latest, ${{ steps.get_version.outputs.VERSION }}"

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FROM node:10.17.0-jessie
33
RUN npm -g config set user root
44
RUN npm -g install scrypt
55

6-
RUN echo "export NODE_PATH=/usr/local/lib/node_modules" >> ~/.profile
7-
RUN echo "export NODE_PATH=/usr/local/lib/node_modules" >> ~/.bashrc
6+
ENV NODE_PATH /usr/local/lib/node_modules
7+
8+
ADD entrypoint.sh /root/
89

910
ENTRYPOINT ["/root/entrypoint.sh"]

entrypoint.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Welcome to nodejs crypto-ready docker build"
4+
echo "System information:"
5+
6+
echo "NODE_PATH:"
7+
echo ${NODE_PATH:-"[EMPTY]"}
8+
9+
echo "Node version:"
10+
node --version
11+
12+
echo "Npm version:"
13+
npm --version
14+
15+
echo "Npm packages installed globally:"
16+
npm list -g --depth 0

0 commit comments

Comments
 (0)