Revert "fix: added the Add CI matrix for Multiple version of node #4" #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
timeout-minutes: 5 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
timeout-minutes: 5 | |
- name: Create Tag | |
id: tag | |
run: echo "tag=${{ env.NODE_VERSION }}-$(git rev-parse --short HEAD)-$(date +%s)" >> $GITHUB_OUTPUT | |
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=${{ env.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 |