Astro: Update to use the detected package manager
This commit is contained in:
+7
-4
@@ -40,12 +40,10 @@ jobs:
|
||||
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
|
||||
echo "::set-output name=manager::yarn"
|
||||
echo "::set-output name=command::install"
|
||||
echo "::set-output name=runner::yarn"
|
||||
exit 0
|
||||
elif [ -f "${{ github.workspace }}/package.json" ]; then
|
||||
echo "::set-output name=manager::npm"
|
||||
echo "::set-output name=command::ci"
|
||||
echo "::set-output name=runner::npx --no-install"
|
||||
exit 0
|
||||
else
|
||||
echo "Unable to determine packager manager"
|
||||
@@ -57,9 +55,14 @@ jobs:
|
||||
node-version: "16"
|
||||
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
||||
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
|
||||
- run: npm install && npm run build
|
||||
- name: Install dependencies
|
||||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
||||
working-directory: ${{ env.BUILD_PATH }}
|
||||
- uses: actions/upload-pages-artifact@v1
|
||||
- name: Build with Astro
|
||||
run: ${{ steps.detect-package-manager.outputs.manager }} run build
|
||||
working-directory: ${{ env.BUILD_PATH }}
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
path: ${{ env.BUILD_PATH }}/dist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user