Build base image #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build base image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version number" | |
| required: true | |
| type: string | |
| jobs: | |
| build-base-image: | |
| name: Builds and pushes the Music Assistant base container to ghcr.io | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Read Python version | |
| id: python | |
| run: echo "version=$(cat .python-version)" >> $GITHUB_OUTPUT | |
| - name: Download Widevine CDM client files from private repository | |
| shell: bash | |
| env: | |
| TOKEN: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} | |
| run: | | |
| mkdir -p widevine_cdm && cd widevine_cdm | |
| curl -OJ -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/music-assistant/appvars/main/widevine_cdm_client/private_key.pem | |
| curl -OJ -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/music-assistant/appvars/main/widevine_cdm_client/client_id.bin | |
| - name: Log in to the GitHub container registry | |
| uses: docker/login-action@v4.2.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4.1.0 | |
| - name: Build and Push image | |
| uses: docker/build-push-action@v7.2.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| file: Dockerfile.base | |
| build-args: | | |
| PYTHON_VERSION=${{ steps.python.outputs.version }} | |
| tags: |- | |
| ghcr.io/${{ github.repository_owner }}/base:${{ inputs.version }}, | |
| ghcr.io/${{ github.repository_owner }}/base:latest | |
| push: true |