diff --git a/.github/workflows/manual-docker-build.yml b/.github/workflows/manual-docker-build.yml new file mode 100644 index 0000000000..fad889d21e --- /dev/null +++ b/.github/workflows/manual-docker-build.yml @@ -0,0 +1,136 @@ +name: Manual Docker Build & Push + +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch to build' + required: true + default: 'develop' + type: string + tag: + description: 'Docker image tag (e.g., "my-feature", "test"). Leave empty for branch name.' + required: false + type: string + platforms: + description: 'Target platforms' + required: true + default: 'linux/amd64' + type: choice + options: + - linux/amd64 + - linux/amd64,linux/arm64 + - linux/amd64,linux/arm/v7,linux/arm64 + +jobs: + build-and-push: + name: Build & Push Docker Image + runs-on: ubuntu-24.04 + permissions: + packages: write + contents: read + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + fetch-depth: 0 + + - name: Setup Node.js for WebUI + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Build WebUI + run: | + cd UI/Web || exit 1 + echo 'Installing web dependencies' + npm ci + + echo 'Building UI' + npm run prod + + echo 'Copying back to Kavita wwwroot' + rsync -a dist/ ../../API/wwwroot/ + cd ../.. + + - name: Get csproj Version + uses: kzrnm/get-net-sdk-project-versions-action@v2 + id: get-version + with: + proj-path: Kavita.Common/Kavita.Common.csproj + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 10.0.x + + - name: Install Swashbuckle CLI + run: dotnet tool install -g Swashbuckle.AspNetCore.Cli + + - name: Build .NET Application + run: ./monorepo-build.sh + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Determine Docker Tag + id: docker-tag + run: | + if [ -n "${{ inputs.tag }}" ]; then + TAG="${{ inputs.tag }}" + else + # Use branch name, sanitized for Docker tags + TAG=$(echo "${{ inputs.branch }}" | sed 's/[^a-zA-Z0-9._-]/-/g') + fi + echo "tag=$TAG" >> $GITHUB_OUTPUT + echo "Using Docker tag: $TAG" + + - name: Extract metadata for Docker + id: docker_meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/kavita + tags: | + type=raw,value=${{ steps.docker-tag.outputs.tag }} + type=raw,value=${{ steps.docker-tag.outputs.tag }}-${{ steps.get-version.outputs.assembly-version }} + type=sha,prefix=${{ steps.docker-tag.outputs.tag }}- + + - name: Build and Push Docker Image + id: docker_build + uses: docker/build-push-action@v6 + with: + context: . + platforms: ${{ inputs.platforms }} + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} + + - name: Summary + run: | + echo "## Docker Image Built Successfully! :rocket:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Branch:** \`${{ inputs.branch }}\`" >> $GITHUB_STEP_SUMMARY + echo "**Version:** \`${{ steps.get-version.outputs.assembly-version }}\`" >> $GITHUB_STEP_SUMMARY + echo "**Platforms:** \`${{ inputs.platforms }}\`" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Images pushed:" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.docker_meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "**Digest:** \`${{ steps.docker_build.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY diff --git a/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts b/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts index 25db1a9bc2..7505c99eb1 100644 --- a/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts +++ b/UI/Web/src/app/admin/manage-narration-settings/manage-narration-settings.component.ts @@ -22,7 +22,7 @@ import { } from '../_models/narration-settings'; import { SettingItemComponent } from '../../settings/_components/setting-item/setting-item.component'; import { SettingSwitchComponent } from '../../settings/_components/setting-switch/setting-switch.component'; -import { NgClass } from '@angular/common'; +import { DecimalPipe, NgClass } from '@angular/common'; import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; @Component({ @@ -36,7 +36,8 @@ import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; SettingItemComponent, SettingSwitchComponent, NgClass, - NgbTooltip + NgbTooltip, + DecimalPipe ] }) export class ManageNarrationSettingsComponent implements OnInit { diff --git a/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html b/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html index 772c33ba62..edb38e6cc4 100644 --- a/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html +++ b/UI/Web/src/app/book-reader/_components/narration-player/narration-player.component.html @@ -37,7 +37,7 @@