Skip to content

Update node.js.yml

Update node.js.yml #16

Workflow file for this run

name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Dependencies
run: |
npm ci
docker-build:
runs-on: self-hosted
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Docker Image
run: |
sudo docker build -t salman4425/instagram-frontend-fe:v1.0 .
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
sudo docker push salman4425/instagram-frontend-fe:v1.0
deploy:
runs-on: self-hosted
needs: docker-build
steps:
- name: Deploy with Docker
run: |
sudo docker pull salman4425/instagram-frontend-fe:v1.0
sudo docker run -d -p 3000:3001 --name instagram-frontend-fe-v1.0 salman4425/instagram-frontend-fe:v1.0