Bump APP_VERSION from v3.1.0 to v3.1.1 #1830
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 and Push AudioMuse AI Docker Image with NVIDIA support | |
| on: | |
| push: | |
| branches: | |
| - main # Trigger on merge/push to main -> 'devel-nvidia' tag | |
| # Trigger on version tags for stable releases | |
| tags: | |
| - 'v*.*.*' # Trigger for version tags like v1.0.0 | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| # Allow manual runs from the Actions UI | |
| workflow_dispatch: | |
| inputs: | |
| version_tag: | |
| description: 'Version tag (e.g., v0.7.12-beta)' | |
| required: true | |
| type: string | |
| jobs: | |
| build-and-push: | |
| # Run on non-PR events; for PR events skip drafts and fork PRs (the | |
| # latter only get a read-only GITHUB_TOKEN and cannot push to ghcr.io). | |
| # Maintainers can build a fork PR manually via workflow_dispatch. | |
| if: >- | |
| github.event_name != 'pull_request' || | |
| (github.event.pull_request.draft == false && | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # Allow checkout to read repository contents | |
| packages: write # Allow pushing to GitHub Container Registry | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| swap-storage: false | |
| large-packages: true # Remove large packages (saves ~8-10 GB) | |
| tool-cache: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| docker-images: true | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine Docker image tags | |
| id: docker_tags | |
| run: | | |
| REPO_NAME_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
| ALL_TAGS="" | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| # When compiling from a version tag, create both the versioned tag and latest-nvidia | |
| VERSION_TAG=$(echo "${GITHUB_REF}" | sed -e 's|refs/tags/v||g') | |
| VERSIONED_TAG="ghcr.io/$REPO_NAME_LOWER:${VERSION_TAG}-nvidia" | |
| LATEST_TAG="ghcr.io/$REPO_NAME_LOWER:latest-nvidia" | |
| ALL_TAGS="${VERSIONED_TAG},${LATEST_TAG}" | |
| echo "Building versioned tag: $VERSIONED_TAG" | |
| echo "Also tagging as latest: $LATEST_TAG" | |
| elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then | |
| # When compiling from main (merged PR), create devel-nvidia tag | |
| DEVEL_TAG="ghcr.io/$REPO_NAME_LOWER:devel-nvidia" | |
| ALL_TAGS="${DEVEL_TAG}" | |
| echo "Building devel tag: $DEVEL_TAG" | |
| elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.draft }}" == "false" ]]; then | |
| PR_NUM="${{ github.event.pull_request.number }}" | |
| PR_TAG="ghcr.io/$REPO_NAME_LOWER:pr-${PR_NUM}-nvidia" | |
| ALL_TAGS="${PR_TAG}" | |
| echo "Building PR tag: $PR_TAG" | |
| elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| # Manual run with version input | |
| VERSION_TAG=$(echo "${{ inputs.version_tag }}" | sed -e 's|^v||g') | |
| VERSIONED_TAG="ghcr.io/$REPO_NAME_LOWER:${VERSION_TAG}-nvidia" | |
| LATEST_TAG="ghcr.io/$REPO_NAME_LOWER:latest-nvidia" | |
| ALL_TAGS="${VERSIONED_TAG},${LATEST_TAG}" | |
| echo "Building manual version tag: $VERSIONED_TAG" | |
| echo "Also tagging as latest: $LATEST_TAG" | |
| else | |
| echo "This workflow is intended to run on tag pushes (refs/tags/v*), devel branch, non-draft pull requests, or manual dispatch. Exiting." | |
| exit 1 | |
| fi | |
| # Export the tags for subsequent steps (comma-separated) | |
| echo "docker_tags=$ALL_TAGS" >> "$GITHUB_OUTPUT" | |
| - name: Build and Push AudioMuse AI Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.docker_tags.outputs.docker_tags }} | |
| build-args: | | |
| BASE_IMAGE=nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04 | |
| cache-from: type=gha,scope=nvidia | |
| cache-to: type=gha,scope=nvidia,mode=max |