Skip to content

Commit

Permalink
Pin node version (#7)
Browse files Browse the repository at this point in the history
* Pin node version

* pin npm version

* pin npm
  • Loading branch information
danielcooperxyz authored Feb 2, 2022
1 parent 80c6059 commit 5dbde1f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 30 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Release

on:
push:
branches: ["main"]
branches: ['main']

jobs:

preconditions:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -66,7 +65,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: "--debug"
buildkitd-flags: '--debug'
- name: Set up Helm
uses: azure/setup-helm@v1
with:
Expand Down Expand Up @@ -109,7 +108,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -130,7 +131,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -151,7 +154,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -167,13 +172,13 @@ jobs:
- name: Sleep
uses: kibertoad/[email protected]
with:
time: "30s"
time: '30s'
- name: Initialise DB
run: npx knex migrate:latest --env test
- name: Run tests
run: npm run test
check-version:
name: "Check version"
name: 'Check version'
runs-on: ubuntu-latest
outputs:
is_new_version: ${{ steps.get_version.outputs.IS_NEW_VERSION }}
Expand All @@ -197,7 +202,7 @@ jobs:
echo "Skipping release as current version has already been published"
publish:
name: "Publish package"
name: 'Publish package'
needs: [preconditions, helm-lint, helm-test, lint, dependency-check, tests, check-version]
runs-on: ubuntu-latest
if: ${{ needs.check-version.outputs.is_new_version == 'true' }}
Expand All @@ -214,7 +219,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: "--debug"
buildkitd-flags: '--debug'
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand Down Expand Up @@ -252,7 +257,7 @@ jobs:
- name: Build release version
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
token: '${{ secrets.GITHUB_TOKEN }}'
tag_name: ${{ needs.check-version.outputs.version }}
prerelease: false
name: ${{ needs.check-version.outputs.version }}
Expand All @@ -268,11 +273,11 @@ jobs:
}
catch (err) {
if (err.status !== 422) throw err
}
}
- name: Build release latest
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
token: '${{ secrets.GITHUB_TOKEN }}'
tag_name: latest
prerelease: false
name: Latest ${{ needs.check-version.outputs.version }}
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Lint and Test

on:
push:
branches-ignore: ["main"]
branches-ignore: ['main']

jobs:
repo_ids:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: "--debug"
buildkitd-flags: '--debug'
- name: Set up Helm
uses: azure/setup-helm@v1
with:
Expand Down Expand Up @@ -101,7 +101,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -121,7 +123,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -142,7 +146,9 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x
- name: Use npm v8
run: npm install -g npm@8
- name: Cache Node.js modules
uses: actions/cache@v1
with:
Expand All @@ -165,7 +171,7 @@ jobs:
run: npm run test

check-version:
name: "Check version"
name: 'Check version'
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.0.0-experimental

FROM node:14.17.0-alpine AS build
FROM node:16-alpine AS build

# Allow log level to be controlled. Uses an argument name that is different
# from the existing environment variable, otherwise the environment variable
Expand All @@ -14,14 +14,14 @@ RUN apk update && \
WORKDIR /vitalam-identity-service

# Install base dependencies
RUN npm -g install npm@latest
RUN npm -g install npm@8.x.x

COPY . .
RUN npm ci --production

##################################################################################################

FROM node:14.17.0-alpine AS runtime
FROM node:16-alpine AS runtime

WORKDIR /vitalam-identity-service

Expand Down
4 changes: 2 additions & 2 deletions helm/vitalam-identity-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: vitalam-identity-service
appVersion: '0.0.3'
appVersion: '0.0.4'
description: A Helm chart for vitalam-identity-service
version: '0.0.3'
version: '0.0.4'
type: application
maintainers:
- name: digicatapult
Expand Down
2 changes: 1 addition & 1 deletion helm/vitalam-identity-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ config:
image:
repository: ghcr.io/digicatapult/vitalam-identity-service
pullPolicy: IfNotPresent
tag: 'v0.0.3'
tag: 'v0.0.4'
pullSecrets: ['ghcr-digicatapult']
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digicatapult/vitalam-identity-service",
"version": "0.0.3",
"version": "0.0.4",
"description": "Identity Service for VITALam",
"main": "app/index.js",
"scripts": {
Expand All @@ -16,7 +16,8 @@
"url": "git+https://github.com/digicatapult/vitalam-identity-service.git"
},
"engines": {
"node": ">=14.17.0"
"node": "16.x.x",
"npm": "8.x.x"
},
"keywords": [
"VITALam"
Expand Down

0 comments on commit 5dbde1f

Please sign in to comment.