Skip to content

Commit 4c2a149

Browse files
committed
Simplify workflow to infer and use NPM
1 parent a21aa73 commit 4c2a149

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

.github/workflows/continuous-deployment.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,11 @@ jobs:
5050
# Configure DocumentDB version (can be overridden by repository variables)
5151
echo "DOCUMENTDB_VERSION=${{ vars.DOCUMENTDB_VERSION || 'latest' }}" >> $GITHUB_ENV
5252
echo "MULTI_VERSION=${{ vars.MULTI_VERSION || 'true' }}" >> $GITHUB_ENV
53-
- name: Detect package manager
54-
id: detect-package-manager
55-
run: |
56-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
57-
echo "manager=yarn" >> $GITHUB_OUTPUT
58-
echo "command=install" >> $GITHUB_OUTPUT
59-
echo "runner=yarn" >> $GITHUB_OUTPUT
60-
exit 0
61-
elif [ -f "${{ github.workspace }}/package.json" ]; then
62-
echo "manager=npm" >> $GITHUB_OUTPUT
63-
echo "command=ci" >> $GITHUB_OUTPUT
64-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
65-
exit 0
66-
else
67-
echo "Unable to determine package manager"
68-
exit 1
69-
fi
7053
- name: Setup Node.js
7154
uses: actions/setup-node@v5
7255
with:
7356
node-version: 24
74-
cache: ${{ steps.detect-package-manager.outputs.manager }}
57+
cache: npm
7558
- name: Restore cache
7659
uses: actions/cache@v4
7760
with:
@@ -83,11 +66,11 @@ jobs:
8366
restore-keys: |
8467
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
8568
- name: Install dependencies
86-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
69+
run: npm ci
8770
- name: Build with Next.js
8871
env:
8972
NEXT_BASE_PATH: ${{ github.event.repository.name }}
90-
run: ${{ steps.detect-package-manager.outputs.runner }} next build
73+
run: npm run build
9174
- name: Download DocumentDB packages from latest release
9275
run: .github/scripts/download_packages.sh
9376
- name: Upload artifact

0 commit comments

Comments
 (0)