Update GitHub Actions workflow for deployment to use bun

This commit is contained in:
Eduard Prigoana 2026-01-24 03:23:13 +02:00 committed by GitHub
parent 943e322890
commit 79d88a9311
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,35 +1,49 @@
name: Deploy to GitHub Pages name: Deploy to GitHub Pages
on: on:
push: push:
branches: [main] branches: [main]
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write # Needed to push to the gh-pages branch contents: write
steps: steps:
- name: Checkout Code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js - name: Setup Bun
uses: actions/setup-node@v3 uses: oven-sh/setup-bun@v1
with: with:
node-version: '22' bun-version: latest
cache: 'npm'
- name: Install Dependencies - name: Cache dependencies
run: npm ci uses: actions/cache@v3
with:
path: |
./bun_modules
./node_modules
./bun.lock
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
- name: Build - name: Install dependencies
run: npm run build run: bun install --frozen-lockfile
- name: Deploy to GitHub Pages - name: Build project
uses: peaceiris/actions-gh-pages@v3 run: bun run build --mode production
with: env:
github_token: ${{ secrets.GITHUB_TOKEN }} NODE_ENV: production
publish_dir: ./dist BUN_BUILD_THREADS: $(nproc)
publish_branch: deployed-ver
force_orphan: true - name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: deployed-ver
force_orphan: true
keep_files: false