1 Commits

Author SHA1 Message Date
Tomas Dvorak 523ebf1c94 fix 2026-04-04 14:39:47 +02:00
2 changed files with 68 additions and 4 deletions
+67
View File
@@ -0,0 +1,67 @@
name: Build and Push Docker Image
on:
push:
branches: [ "master", "main" ]
paths:
- 'src/**'
- 'swingmusic-webclient/**'
- 'pyproject.toml'
- 'requirements.txt'
- 'Dockerfile'
workflow_dispatch:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
+1 -4
View File
@@ -36,12 +36,9 @@ RUN apt-get update \
COPY pyproject.toml requirements.txt version.txt ./ COPY pyproject.toml requirements.txt version.txt ./
COPY src/ ./src/ COPY src/ ./src/
# Install the package and its dependencies # Install the package and its dependencies (includes aiohttp, aiofiles, redis)
RUN pip install --no-cache-dir . RUN pip install --no-cache-dir .
# Install Redis library for DragonflyDB support
RUN pip install --no-cache-dir redis
# Ship a deterministic web client with the backend image so startup does not # Ship a deterministic web client with the backend image so startup does not
# depend on downloading release assets at runtime. # depend on downloading release assets at runtime.
COPY --from=webclient-builder /webclient/dist /app/client COPY --from=webclient-builder /webclient/dist /app/client