Skip to content

Commit 72e4b42

Browse files
Update workflow
1 parent 1cd8394 commit 72e4b42

File tree

1 file changed

+11
-36
lines changed

1 file changed

+11
-36
lines changed

.github/workflows/astro.yml

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
# Sample workflow for building and deploying an Astro site to GitHub Pages
2-
#
3-
# To get started with Astro see: https://docs.astro.build/en/getting-started/
4-
#
5-
name: Deploy Astro site to Pages
1+
name: Deploy Astro site to Pages with Bun
62

73
on:
8-
# Runs on pushes targeting the default branch
94
push:
105
branches: ["prod"]
116

12-
# Allows you to run this workflow manually from the Actions tab
137
workflow_dispatch:
148

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
169
permissions:
1710
contents: read
1811
pages: write
1912
id-token: write
2013

21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2314
concurrency:
2415
group: "pages"
2516
cancel-in-progress: false
@@ -35,43 +26,27 @@ jobs:
3526
steps:
3627
- name: Checkout
3728
uses: actions/checkout@v4
38-
- name: Detect package manager
39-
id: detect-package-manager
40-
run: |
41-
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42-
echo "manager=yarn" >> $GITHUB_OUTPUT
43-
echo "command=install" >> $GITHUB_OUTPUT
44-
echo "runner=yarn" >> $GITHUB_OUTPUT
45-
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
46-
exit 0
47-
elif [ -f "${{ github.workspace }}/package.json" ]; then
48-
echo "manager=npm" >> $GITHUB_OUTPUT
49-
echo "command=ci" >> $GITHUB_OUTPUT
50-
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
51-
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
52-
exit 0
53-
else
54-
echo "Unable to determine package manager"
55-
exit 1
56-
fi
57-
- name: Setup Node
58-
uses: actions/setup-node@v4
29+
30+
- name: Setup Bun
31+
uses: oven-sh/setup-bun@v1
5932
with:
60-
node-version: "20"
61-
cache: ${{ steps.detect-package-manager.outputs.manager }}
62-
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
33+
bun-version: latest
34+
6335
- name: Setup Pages
6436
id: pages
6537
uses: actions/configure-pages@v5
38+
6639
- name: Install dependencies
67-
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
40+
run: bun install
6841
working-directory: ${{ env.BUILD_PATH }}
42+
6943
- name: Build with Astro
7044
run: |
71-
${{ steps.detect-package-manager.outputs.runner }} astro build \
45+
bunx astro build \
7246
--site "${{ steps.pages.outputs.origin }}" \
7347
--base "${{ steps.pages.outputs.base_path }}"
7448
working-directory: ${{ env.BUILD_PATH }}
49+
7550
- name: Upload artifact
7651
uses: actions/upload-pages-artifact@v3
7752
with:

0 commit comments

Comments
 (0)