Skip to content

Commit

Permalink
chore: bump to node.js to v14.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwalther committed May 29, 2020
1 parent e6c33c9 commit f429c3c
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build-master

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Read .nvmrc
id: nvmrc
uses: pCYSl5EDgo/cat@master
with:
path: ./.nvmrc
trim: true

- name: Set Env Variables
id: set-env
uses: allenevans/[email protected]
with:
overwrite: false
DOCKER_REGISTRY: "docker.pkg.github.com"
DOCKER_REPO_OWNER: "stefanwalther"
DOCKER_REPO_NAME: "besser-app-api"
DOCKER_IMAGE_NAME: "besser-app-api"
DOCKER_IMAGE_TAG: "latest"
NODE_VER: "${{ steps.nvmrc.outputs.text }}"

- name: build
id: build
run: |
make build
- name: build-test
id: build-test
run: |
make build-test
- name: linter
id: run-linter
run: |
make run-linter
- name: tests
run: make run-tests

- name: publish to registry (only master)
if: github.ref == 'refs/heads/master'
run: |
docker login ${{ env.DOCKER_REGISTRY }} --username ${{ env.DOCKER_REPO_OWNER }} --password ${{ secrets.GITHUB_TOKEN }}
docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPO_OWNER}}/${{ env.DOCKER_REPO_NAME }}/${{ env.DOCKER_IMAGE_NAME}}:${{ env.DOCKER_IMAGE_TAG }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.3.0
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ARG NODE_VER="14.3.0"
# --------------------------------------
# BASE NODE
# --------------------------------------
FROM node:8.17.0-alpine as BASE
FROM node:${NODE_VER}-alpine as BASE

ARG PORT=3000
ENV PORT=$PORT
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NODE_VER := $(shell cat .nvmrc)

help: ## Show this help.
@echo ''
@echo 'Available commands:'
Expand All @@ -8,3 +10,7 @@ help: ## Show this help.
gen-readme: ## Generate README.md (using docker-verb)
docker run --rm -v ${PWD}:/opt/verb stefanwalther/verb
.PHONY: gen-readme

build:
docker build -t stefanwalther/docker-test .
.PHONY: build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docker-test",
"version": "0.3.2",
"version": "0.4.0",
"description": "Sample docker image to test various scenarios with Docker.",
"keywords": [
"docker",
Expand Down

0 comments on commit f429c3c

Please sign in to comment.