Skip to content

Update index.js

Update index.js #8

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI & Docker Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
deploy:
runs-on: self-hosted
strategy:
matrix:
node-version: [14.x]
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v3
# Use Node.js
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# Install Node dependencies
- name: Install Node dependencies
run: npm ci
# Build Node project
- name: Build Node project
run: npm run build --if-present
# Install additional dependencies (optional)
- name: Install additional dependencies
run: npm install
# Build Docker Compose images
- name: Build Docker Compose images
working-directory: /home/mnagaraju/actions-runner-repo2/testing-project-2
run: docker-compose -f docker-compose-test.yml build --no-cache app
# Start Docker Compose services
- name: Start Docker Compose services
working-directory: /home/mnagaraju/actions-runner-repo2/testing-project-2
run: docker-compose -f docker-compose-test.yml up -d app