Skip to content

Commit

Permalink
chore: bump node, implement proper ci cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed Oct 20, 2022
1 parent 87301fe commit 9b0b4d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yaml
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
jobs:
build-lint:
build_lint:
name: Build and lint
runs-on: ubuntu-latest
steps:
Expand All @@ -13,20 +13,28 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.6.1
- name: Setup build cache
uses: actions/cache@v2
node-version: 16.18.0
- name: Cache mode modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles("**/package-lock.json") }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != "true"
run: npm ci
- name: Compile TypeScript
run: npm run compile
- name: Run linter
run: npm run lint
build-docker:
build_docker:
name: Build Docker image
runs-on: ubuntu-latest
steps:
Expand All @@ -41,5 +49,5 @@ jobs:
- 'Dockerfile'
- 'package*.json'
- name: Build Docker image
if: steps.filter.outputs.build == 'true'
if: steps.filter.outputs.build == "true"
run: docker build .
2 changes: 1 addition & 1 deletion .node-version
@@ -1 +1 @@
16.6.1
16.18.0
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM node:16.6.1-alpine3.13 AS builder
FROM node:16.18.0-alpine3.16 AS builder

LABEL org.opencontainers.image.source="https://github.com/jef/streetmerchant"

Expand All @@ -16,7 +16,7 @@ COPY test/ test/
RUN npm run compile
RUN npm prune --production

FROM node:16.6.1-alpine3.13
FROM node:16.18.0-alpine3.16

RUN apk add --no-cache chromium

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -85,6 +85,6 @@
"webpack": "^5.50.0"
},
"volta": {
"node": "16.6.1"
"node": "16.18.0"
}
}

0 comments on commit 9b0b4d1

Please sign in to comment.