Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunmankar authored Dec 9, 2024
1 parent 0b695ad commit bac7e78
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
name: CI/CD for Developer Community React Project
name: Deploy to GitHub Pages

on:
push:
branches:
- main # Trigger when changes are pushed to the main branch
pull_request:
branches:
- main # Trigger on PRs to the main branch
- main # Deploy on push to the main branch

jobs:
test:
deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the code
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Node.js (React environment)
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
uses: actions/checkout@v2

# Step 3: Install dependencies
# Install dependencies and build the project (if needed)
- name: Install dependencies
run: npm install
run: |
npm install
npm run build
# Step 4: Run tests
- name: Run tests
run: npm test -- --ci --silent --coverage
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # Specify the target branch for GitHub Pages
folder: build # Specify the folder to deploy (e.g., "build" for React)
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bac7e78

Please sign in to comment.