Skip to content

Update docker-build.yml #8

Update docker-build.yml

Update docker-build.yml #8

Workflow file for this run

name: Docker CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
Build-Push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag lidorlg/node-hello-lidor-new:latest
- name: login to docker hub
run: docker login -u lidorlg -p ${{ secrets.dockerhub_password }}
- name: Push the Docker image
run: docker push lidorlg/node-hello-lidor-new:latest
Deploy-container:
needs: Build-Push
runs-on: ubuntu-latest
steps:
- name: Deploy container
run: |
docker run -d --name node-hello-lidor -p 3000:3000 lidorlg/node-hello-lidor-new
sleep 10 && curl localhost:3000