/
/
/
1name: Build and Push Music Assistant Server
2
3on:
4 push:
5 branches:
6 - dev-lidarr-plugin
7
8env:
9 REGISTRY: ${{ secrets.HARBOR_URL }}
10 PROJECT: docker
11 IMAGE_REPO: music-assistant-server
12 MASS_VERSION: "0.0.1.dev1"
13 # Must match BASE_IMAGE_VERSION_STABLE in upstream .github/workflows/release.yml.
14 # The base image ships the FFmpeg/PyAV pair the build verifies against, so
15 # floating on :latest breaks the build whenever upstream publishes a new base.
16 BASE_IMAGE_VERSION: "1.6.3"
17
18jobs:
19 build-and-push:
20 runs-on: ubuntu-latest
21 steps:
22 - name: Checkout repository
23 uses: actions/checkout@v4
24
25 - name: Set up Python
26 uses: actions/setup-python@v5
27 with:
28 # Read the pinned runtime from .python-version instead of hardcoding it,
29 # so an upstream sync cannot silently leave this workflow behind.
30 python-version-file: ".python-version"
31
32 - name: Build Python wheel
33 run: |
34 pip install build
35 python3 -m build
36
37 - name: Verify dist
38 run: |
39 ls -la dist/
40 # The Dockerfile installs this exact filename, so a drift between
41 # pyproject's version and MASS_VERSION must fail here, not mid-build.
42 test -f "dist/music_assistant-${MASS_VERSION}-py3-none-any.whl"
43
44 - name: Set up Docker Buildx
45 uses: docker/setup-buildx-action@v3
46 with:
47 driver: docker
48
49 - name: Login to Harbor Registry
50 uses: docker/login-action@v3
51 with:
52 registry: ${{ env.REGISTRY }}
53 username: ${{ secrets.HARBOR_USERNAME }}
54 password: ${{ secrets.HARBOR_PASSWORD }}
55
56 - name: Build and push image
57 uses: docker/build-push-action@v5
58 with:
59 context: .
60 push: true
61 tags: |
62 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:latest
63 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:${{ github.sha }}
64 build-args: |
65 MASS_VERSION=${{ env.MASS_VERSION }}
66 BASE_IMAGE_VERSION=${{ env.BASE_IMAGE_VERSION }}
67 cache-from: |
68 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:latest
69