Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jatiinyadav authored Feb 10, 2025
1 parent 42dd82b commit a4ff098
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy React App to GitHub Pages
on:
push:
branches:
- react_ui
- react_ui # Change to your actual branch name
workflow_dispatch:

permissions:
Expand All @@ -25,27 +25,34 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "18"
cache: npm

- name: Install Dependencies
run: npm install
run: npm install # Use `npm install` instead of `npm ci` if lock file issues occur

- name: Build Project
run: npm run build
run: npm run build

- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-artifact@v3 # Ensure artifact is uploaded correctly
with:
path: ./build
name: github-pages # Name should match in both upload & download steps
path: ./build # Ensure build folder exists before uploading

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: github-pages
path: ./build # Download the artifact to the correct folder

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3

0 comments on commit a4ff098

Please sign in to comment.