diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..1a4c3d1 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,58 @@ +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 + + - 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: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile --production + + - 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