Skip to content

fix: added docker meta tag in the co for the tag #8 #18

fix: added docker meta tag in the co for the tag #8

fix: added docker meta tag in the co for the tag #8 #18

Workflow file for this run

name: Build and Push
on:
push:
env:
NODE_VERSION: "20.10.0"
ALPINE_VERSION: "3.18"
jobs:
build:
name: Build and Push Image
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 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: ${{ secrets.DOCKERHUB_ORGANIZATION }}/${{ vars.DOCKERHUB_IMAGE }}
tags: |
type=raw,value=${{ matrix.node-version }}-{{branch}}-{{sha}}-{{date 'X'}}
type=raw,value=${{ matrix.node-version }}-{{branch}}-latest
- 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: "improwised/docker-nodejs-base:${{ steps.tag.outputs.tag }}"
timeout-minutes: 10