Files
tipilan/.github/workflows/build.yml

53 lines
1.2 KiB
YAML

name: build
on:
workflow_call:
inputs:
ref:
description: Branch or tag to checkout
required: false
default: teaser-2026
type: string
secrets:
USER_AUTH:
required: true
jobs:
build:
runs-on: prox-1
steps:
- name: Clear .next cache
env:
SUDO_PASSWORD: ${{ secrets.USER_AUTH }}
run: echo "$SUDO_PASSWORD" | sudo -S rm -rf $GITHUB_WORKSPACE/.next
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Ensure symlink to database before Drizzle migrations
if: ${{ inputs.ref == 'main' }}
run: |
rm -rf $GITHUB_WORKSPACE/data
ln -s ~/data $GITHUB_WORKSPACE/data
- name: Generate Drizzle schema
if: ${{ inputs.ref == 'main' }}
run: bun drizzle-kit generate
- name: Run Drizzle migrations
if: ${{ inputs.ref == 'main' }}
run: bun drizzle-kit migrate
- name: Build project
run: bun --bun run build