feat: Add MySQL-style SET/SHOW VARIABLES and runtime configuration ma… #13
Workflow file for this run
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: Docker Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Trigger on version tags like v1.0.0, v2.1.3, etc. | |
| workflow_dispatch: # Allow manual trigger | |
| env: | |
| REGISTRY_GHCR: ghcr.io | |
| REGISTRY_DOCKERHUB: docker.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-push: | |
| name: Build and Push Docker Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for creating GitHub releases | |
| packages: write # Required for pushing to ghcr.io | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - 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 GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY_GHCR }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Optional: Log in to Docker Hub | |
| # Uncomment and set DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets | |
| # - name: Log in to Docker Hub | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ${{ env.REGISTRY_DOCKERHUB }} | |
| # username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| # password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ env.REGISTRY_GHCR }}/${{ env.IMAGE_NAME }} | |
| # Uncomment to also push to Docker Hub | |
| # ${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| # Extract version from git tag (remove 'v' prefix if present) | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| MYGRAMDB_VERSION=${{ steps.version.outputs.version }} | |
| cache-from: | | |
| type=gha,scope=docker-build | |
| type=gha,scope=docker-release | |
| cache-to: type=gha,mode=max,scope=docker-release | |
| # Note: GitHub Release is created by release.yml workflow | |
| # This workflow only builds and publishes Docker images |