name: Publish to Docker Hub on: release: types: [published] permissions: contents: read jobs: docker: name: Build & Push Docker Image runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - name: Extract version from release tag id: version run: | VERSION="${GITHUB_REF_NAME}" VERSION="${VERSION#v}" echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "Publishing Docker image version: $VERSION" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v6 with: context: . target: runner-base push: true tags: | diegosouzapw/omniroute:${{ steps.version.outputs.version }} diegosouzapw/omniroute:latest cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64 - name: Update Docker Hub description uses: peter-evans/dockerhub-description@v5 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: diegosouzapw/omniroute short-description: "OmniRoute — Unified AI proxy. Route any LLM through one endpoint." readme-filepath: ./README.md