update buildfile
This commit is contained in:
12
.github/workflows/astro.yml
vendored
12
.github/workflows/astro.yml
vendored
@@ -7,7 +7,7 @@ name: Deploy Astro site to Pages
|
|||||||
on:
|
on:
|
||||||
# Runs on pushes targeting the default branch
|
# Runs on pushes targeting the default branch
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: [$default-branch]
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -42,11 +42,13 @@ jobs:
|
|||||||
echo "manager=yarn" >> $GITHUB_OUTPUT
|
echo "manager=yarn" >> $GITHUB_OUTPUT
|
||||||
echo "command=install" >> $GITHUB_OUTPUT
|
echo "command=install" >> $GITHUB_OUTPUT
|
||||||
echo "runner=yarn" >> $GITHUB_OUTPUT
|
echo "runner=yarn" >> $GITHUB_OUTPUT
|
||||||
|
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
elif [ -f "${{ github.workspace }}/package.json" ]; then
|
elif [ -f "${{ github.workspace }}/package.json" ]; then
|
||||||
echo "manager=npm" >> $GITHUB_OUTPUT
|
echo "manager=npm" >> $GITHUB_OUTPUT
|
||||||
echo "command=ci" >> $GITHUB_OUTPUT
|
echo "command=ci" >> $GITHUB_OUTPUT
|
||||||
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
|
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
|
||||||
|
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Unable to determine package manager"
|
echo "Unable to determine package manager"
|
||||||
@@ -57,10 +59,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
||||||
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
|
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
id: pages
|
id: pages
|
||||||
uses: actions/configure-pages@v4
|
uses: actions/configure-pages@v5
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
||||||
working-directory: ${{ env.BUILD_PATH }}
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
@@ -71,7 +73,7 @@ jobs:
|
|||||||
--base "${{ steps.pages.outputs.base_path }}"
|
--base "${{ steps.pages.outputs.base_path }}"
|
||||||
working-directory: ${{ env.BUILD_PATH }}
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v2
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.BUILD_PATH }}/dist
|
path: ${{ env.BUILD_PATH }}/dist
|
||||||
|
|
||||||
@@ -85,4 +87,4 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v3
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user