From 9e6fbee729e3f6b567ca882b5feba3a6984e7ee0 Mon Sep 17 00:00:00 2001 From: ujwal pachghare <131592212+Uj5Ghare@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:48:23 +0530 Subject: [PATCH] refactor(ci/cd) Update gh-pages.yml --- .github/workflows/gh-pages.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 38f151b..2bff777 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -34,12 +34,12 @@ jobs: - name: Detect package manager id: detect-package-manager run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then + if [ -f "${{ github.workspace }}/frontend/yarn.lock" ]; then echo "manager=yarn" >> $GITHUB_OUTPUT echo "command=install" >> $GITHUB_OUTPUT echo "runner=yarn" >> $GITHUB_OUTPUT exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then + elif [ -f "${{ github.workspace }}/frontend/package.json" ]; then echo "manager=npm" >> $GITHUB_OUTPUT echo "command=ci" >> $GITHUB_OUTPUT echo "runner=npx --no-install" >> $GITHUB_OUTPUT @@ -59,12 +59,14 @@ jobs: uses: actions/cache@v4 with: path: | - ./build + ./frontend/build # Generate a new cache whenever packages or source files change. key: ${{ runner.os }}-Reactjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | ${{ runner.os }}-Reactjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Change directory to frontend + run: cd frontend/ - name: Install dependencies run: npm install - name: Build with React.js @@ -72,7 +74,7 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./build + path: ./frontend/build # Deployment job deploy: