# Publish Docker images to GitHub Container Registry (GHCR). # # Triggers: # - push of a tag matching `v*` (e.g. `v0.2.7`) → pushed as :0.2.7 + :latest # - workflow_dispatch → pushed as :sha- (for testing) # # Images land at: ghcr.io/debpalash/omnivoice-studio name: Docker (GHCR) on: push: tags: ['v*'] workflow_dispatch: permissions: contents: read packages: write env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: build-and-push: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 # QEMU enables cross-platform builds (arm64 on x64 runner). # Skipped for now — only building linux/amd64. # - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to GHCR uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} # Extracts semver tags from the git ref: # v0.2.7 → 0.2.7, latest # manual dispatch → sha-abc1234 - name: Extract metadata (tags, labels) id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=sha,prefix=sha-,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push uses: docker/build-push-action@v6 with: context: . file: deploy/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max