Skip to content

Merge branch 'master' of https://github.com/rajpatelbot/noteapp #1

Merge branch 'master' of https://github.com/rajpatelbot/noteapp

Merge branch 'master' of https://github.com/rajpatelbot/noteapp #1

Workflow file for this run

name: Deploy Node Application
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Login to docker hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
run: docker build -t rajpatelbot/noteapp-backend .
- name: Publish Image to docker hub
run: docker push rajpatelbot/noteapp-backend:latest
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Pull image from docker hub
run: docker pull rajpatelbot/noteapp-backend:latest
- name: Delete old container
run: docker rm -f nodejs-app-container
- name: Run Docker Container
run: docker run -d -p 4000:4000 --name nodejs-app-container -e MONGO_PASSWORD='${{ secrets.MONGO_PASSWORD }}' rajpatelbot/noteapp-backend