ci: bump action versions (checkout v6, login v4, metadata v6) #3
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: mcp-mysql | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - mcp/mysql/** | |
| - .github/workflows/mcp-mysql.yaml | |
| tags: | |
| - 'mcp-mysql/v*' | |
| pull_request: | |
| paths: | |
| - mcp/mysql/** | |
| - .github/workflows/mcp-mysql.yaml | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build image | |
| id: build | |
| uses: redhat-actions/buildah-build@v2.13 | |
| with: | |
| image: mcp-mysql | |
| tags: ${{ github.sha }}-${{ matrix.arch }} | |
| containerfiles: ./mcp/mysql/Containerfile | |
| platforms: linux/${{ matrix.arch }} | |
| - name: Push per-arch image | |
| if: github.event_name != 'pull_request' | |
| uses: redhat-actions/push-to-registry@v2.8 | |
| with: | |
| image: ${{ steps.build.outputs.image }} | |
| tags: ${{ steps.build.outputs.tags }} | |
| registry: ghcr.io/${{ github.repository_owner }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| manifest: | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| packages: write | |
| steps: | |
| - uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/mcp-mysql | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=match,pattern=mcp-mysql/v(.*),group=1 | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| IMAGE="ghcr.io/${{ github.repository_owner }}/mcp-mysql" | |
| while IFS= read -r tag; do | |
| docker buildx imagetools create \ | |
| -t "$tag" \ | |
| "${IMAGE}:${{ github.sha }}-amd64" \ | |
| "${IMAGE}:${{ github.sha }}-arm64" | |
| done <<< "${{ steps.meta.outputs.tags }}" |