diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..102b924 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,36 @@ +name: Build & Release Bun App + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: docker + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Bun + run: | + curl -fsSL https://bun.sh/install | bash + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" + bun install + + - name: Build Bun app + run: | + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" + bun run build + + - name: Archive dist folder + run: | + tar -czf bun-app.tar.gz ./dist + + - name: Upload release asset to Forgejo + uses: https://code.forgejo.org/actions/upload-release-asset@v1 + with: + tag: ${{ github.ref_name }} + file: bun-app.tar.gz diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..50cc09c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM oven/bun:latest + +WORKDIR /app + +COPY package.json ./ + +RUN test -f bun.lockb && cp bun.lockb . || true + +RUN [ -f bun.lockb ] && bun install --frozen-lockfile || bun install + +COPY . . + +CMD ["bun", "run", "start"] diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..64e3875 --- /dev/null +++ b/compose.yml @@ -0,0 +1,18 @@ +services: + booru-api: + container_name: profilePage + build: + context: . + volumes: + - .:/app/profilePage + restart: unless-stopped + ports: + - "${PORT:-8080}:${PORT:-8080}" + env_file: + - .env + networks: + - profilePage-network + +networks: + profilePage-network: + driver: bridge