From a4ff0989ed590876d7b2722f861b4aa0e7762a6f Mon Sep 17 00:00:00 2001 From: Jatin Yadav <73248007+jatiinyadav@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:35:08 +0530 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 38889ee8..0c3df919 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: @@ -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