Skip to content

Merge pull request #11 from Improwised/feat/add-node-14 #27

Merge pull request #11 from Improwised/feat/add-node-14

Merge pull request #11 from Improwised/feat/add-node-14 #27

Workflow file for this run

name: Build and Push
on:
push:
env:
ALPINE_VERSION: "3.18"
jobs:
build:
name: Build and Push Image
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.19.1,18, 19, 20] # List of Node.js versions to test
steps:
- name: Checkout code
uses: actions/checkout@v4
timeout-minutes: 5
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: improwised/docker-nodejs-base
tags: |
type=raw,value=${{ matrix.node-version }}-{{sha}}-{{date 'X'}}
type=raw,value=${{ matrix.node-version }}-latest
timeout-minutes: 2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
timeout-minutes: 5
- name: Login to Docker Hub
if: ${{ github.ref_name == 'main' }}
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
timeout-minutes: 5
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
build-args: |
NODE_VERSION=${{ matrix.node-version }}
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
context: .
push: ${{ github.ref_name == 'main' }}
tags: ${{ steps.meta.outputs.tags }}
timeout-minutes: 10