Skip to content

Commit

Permalink
refactor(ci/cd) Update gh-pages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Uj5Ghare authored Dec 8, 2024
1 parent defb948 commit 9e6fbee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,20 +59,22 @@ 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
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./build
path: ./frontend/build

# Deployment job
deploy:
Expand Down

0 comments on commit 9e6fbee

Please sign in to comment.