WIP. A little custom music server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

github action for backend

+103 -34
+103
.github/workflows/backend.yaml
··· 1 + name: Backend CI/CD 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + - develop 8 + paths: 9 + - 'backend/**' 10 + - 'shared/**' 11 + - 'package.json' 12 + - 'bun.lock' 13 + - '.github/workflows/backend.yaml' 14 + pull_request: 15 + branches: 16 + - main 17 + - develop 18 + paths: 19 + - 'backend/**' 20 + - 'shared/**' 21 + - 'package.json' 22 + - 'bun.lock' 23 + - '.github/workflows/backend.yaml' 24 + 25 + env: 26 + REGISTRY: ghcr.io 27 + IMAGE_NAME: ${{ github.repository }}-backend 28 + 29 + jobs: 30 + build-and-test: 31 + runs-on: ubuntu-latest 32 + permissions: 33 + contents: read 34 + 35 + steps: 36 + - name: Checkout code 37 + uses: actions/checkout@v4 38 + 39 + - name: Setup Bun 40 + uses: oven-sh/setup-bun@v2 41 + with: 42 + bun-version: latest 43 + 44 + - name: Cache Bun dependencies 45 + uses: actions/cache@v4 46 + with: 47 + path: ~/.bun/install/cache 48 + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} 49 + restore-keys: | 50 + ${{ runner.os }}-bun- 51 + 52 + - name: Install dependencies 53 + run: bun install --frozen-lockfile 54 + 55 + - name: Run backend tests 56 + run: bun --filter @boombox/backend test 57 + working-directory: ./ 58 + 59 + - name: Build backend 60 + run: bun --filter @boombox/backend build 61 + working-directory: ./ 62 + 63 + docker-publish: 64 + runs-on: ubuntu-latest 65 + needs: build-and-test 66 + if: github.ref == 'refs/heads/main' && github.event_name == 'push' 67 + permissions: 68 + contents: read 69 + packages: write 70 + 71 + steps: 72 + - name: Checkout code 73 + uses: actions/checkout@v4 74 + 75 + - name: Set up Docker Buildx 76 + uses: docker/setup-buildx-action@v3 77 + 78 + - name: Log in to GitHub Container Registry 79 + uses: docker/login-action@v3 80 + with: 81 + registry: ${{ env.REGISTRY }} 82 + username: ${{ github.actor }} 83 + password: ${{ secrets.GITHUB_TOKEN }} 84 + 85 + - name: Extract metadata (tags, labels) 86 + id: meta 87 + uses: docker/metadata-action@v5 88 + with: 89 + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 90 + tags: | 91 + type=raw,value=latest,enable={{is_default_branch}} 92 + type=sha,prefix=sha-,format=short 93 + 94 + - name: Build and push Docker image 95 + uses: docker/build-push-action@v5 96 + with: 97 + context: . 98 + file: ./backend/Dockerfile 99 + push: true 100 + tags: ${{ steps.meta.outputs.tags }} 101 + labels: ${{ steps.meta.outputs.labels }} 102 + cache-from: type=gha 103 + cache-to: type=gha,mode=max
-34
backend/.github/workflows/main.yaml
··· 1 - name: Test 2 - 3 - on: 4 - push: 5 - branches: [main] 6 - pull_request: 7 - branches: [main] 8 - 9 - jobs: 10 - test: 11 - runs-on: ubuntu-latest 12 - 13 - steps: 14 - - name: Checkout code 15 - uses: actions/checkout@v4 16 - 17 - - name: Setup Bun 18 - uses: oven-sh/setup-bun@v2 19 - with: 20 - bun-version: latest 21 - 22 - - name: Cache dependencies 23 - uses: actions/cache@v3 24 - with: 25 - path: ~/.bun/install/cache 26 - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} 27 - restore-keys: | 28 - ${{ runner.os }}-bun- 29 - 30 - - name: Install dependencies 31 - run: bun install --frozen-lockfile 32 - 33 - - name: Run tests 34 - run: bun run test