-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.58 KB
/
ci-node.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Docker image (Node)
on:
push:
branches:
- master
paths:
- 'nodejs.Dockerfile'
- 'nodejs.entrypoint.sh'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nodejs:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') }}
strategy:
fail-fast: false
matrix:
node_version: [12, 14, 16, 18, 19, 20]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
build-args: NODE_VERSION=${{ matrix.node_version }}
context: .
file: nodejs.Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: djoh/all-in-one:node${{ matrix.node_version }}
cache-from: type=registry,ref=djoh/all-in-one:buildcache_node${{ matrix.node_version }}
cache-to: type=registry,ref=djoh/all-in-one:buildcache_node${{ matrix.node_version }},mode=max