From 5a085a46d48804b556e0c00a8e5c339ff85f801d Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sun, 15 Jun 2025 17:59:53 +0700 Subject: [PATCH] ci: add `build` --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..258dee8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build + +on: + workflow_dispatch: + push: + branches: + - dev + - main + pull_request: + branches: + - dev + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Restore Bun cache + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} + restore-keys: | + ${{ runner.os }}-bun- + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build development bundle + run: bun run build --dev + + - name: Upload development bundle + uses: actions/upload-artifact@v4 + with: + name: revenge-bundle-development + path: dist/revenge.bundle + if-no-files-found: error + + - name: Clear build + run: rm -rf dist + + - name: Build production bundle + run: bun run build + + - name: Upload production bundle + uses: actions/upload-artifact@v4 + with: + name: revenge-bundle + path: dist/revenge.bundle + if-no-files-found: error \ No newline at end of file