Skip to content

Commit 21c27ba

Browse files
committed
ci: fix Node.js version and eliminate duplicate build
- Add actions/setup-node@v4 with node-version 22 to setup-bun composite action to satisfy Astro 5+ requirement (>=22.12.0) - Upload dist artifact from ci job and download in deploy job so the build runs once instead of twice - Reduce deploy job timeout from 10 to 5 minutes
1 parent c5aa6dd commit 21c27ba

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/actions/setup-bun/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: Setup Bun and install dependencies
2-
description: Sets up Bun, caches Bun downloads, and installs dependencies with a frozen lockfile
2+
description: Sets up Node.js, Bun, caches Bun downloads, and installs dependencies with a frozen lockfile
33
runs:
44
using: composite
55
steps:
6+
- name: Setup Node.js
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version: '22'
10+
611
- name: Setup Bun
712
uses: oven-sh/setup-bun@v2
813

.github/workflows/main.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,26 @@ jobs:
2323
- uses: actions/checkout@v6
2424
- uses: ./.github/actions/setup-bun
2525
- run: bun run ci
26+
- uses: actions/upload-artifact@v4
27+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
28+
with:
29+
name: dist
30+
path: dist
31+
retention-days: 1
2632

2733
deploy:
2834
needs: ci
2935
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
3036
runs-on: ubuntu-latest
31-
timeout-minutes: 10
37+
timeout-minutes: 5
3238
environment:
3339
name: github-pages
3440
url: ${{ steps.deployment.outputs.page_url }}
3541
steps:
36-
- uses: actions/checkout@v6
37-
- uses: ./.github/actions/setup-bun
38-
- run: bun run build
42+
- uses: actions/download-artifact@v4
43+
with:
44+
name: dist
45+
path: dist
3946
- uses: actions/upload-pages-artifact@v4
4047
with:
4148
path: dist

0 commit comments

Comments
 (0)