Skip to content

Update node.js.yml

Update node.js.yml #10

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 instagram-reimaged-fe:latest .
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
sudo docker push salman4425/instagram-frontend-fe:instagram-reimaged-fe:latest
deploy:
runs-on: self-hosted
needs: docker-build
steps:
- name: Deploy with Docker
run: |
sudo docker pull instagram-reimaged-fe:latest
sudo docker run -d -p 3000:3001 --name instagram-reimaged-fe:latest