name: bun-landing
on:
  push:
    paths:
      - packages/bun-landing/**/*
    branches: [main]

jobs:
  build:
    name: website build
    runs-on: ubuntu-latest
    if: github.repository_owner == 'oven-sh'
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 16

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Use Node ${{ matrix.node }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node }}

      - name: Install bun
        uses: xhyrom/setup-bun@v0.1.2
        with:
          bun-version: latest

      - name: Install global dependencies
        run: bun install

      - name: Install package dependencies
        run: cd packages/bun-landing && bun install

      - name: Build
        run: cd packages/bun-landing && bun run build.tsx

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: build:(landing) automated website build
          token: ${{ secrets.GITHUB_TOKEN }}
