Skip to content
Open

Ajay #178

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@

name: Deploy
name: Build and Push Docker Image

on:
push:
branches: [ "main" ]
branches:
- ajay # Trigger only on push to this branch

jobs:
deploy:

build-and-push:
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
- run: docker build . -t harishneel/next-js-app
- run: echo "${{secrets.DOCKERHUB_PASSWORD}}" | docker login -u ${{secrets.DOCKERHUB_USERNAME}} --password-stdin
- run: docker push harishneel/next-js-app:latest
# Step 1: Checkout the code
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Docker Buildx (for multi-platform builds if needed)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Step 3: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# Step 4: Build Docker image
- name: Build Docker image
run: |
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/kamlesh:satpal

# Step 5: Push Docker image to DockerHub
- name: Push Docker image
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/kamlesh:satpal
68 changes: 25 additions & 43 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@

name: Integration
name: CI Pipeline

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- ajay

jobs:
build:

build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: "Installing Dependencies"
run: npm i

- name: "Build command"
run: npm run build

unit-tests:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: "Installing Dependencies"
run: npm i

- name: "Running test cases"
run: npm run test
# Step 1: Checkout code
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Set up Node.js (change version if needed)
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

# Step 3: Install dependencies
- name: Install Dependencies
run: npm install

# Step 4: Build the applicatio
- name: Build Application
run: npm run build

# Step 5: Run tests
- name: Run Tests
run: npm test