feat!: new configuration schema and support for more OAuth providers #229
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 docker image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
platform: | |
- arch: linux/amd64 | |
runner: ubuntu-latest | |
- arch: linux/arm64 | |
runner: ubuntu-24.04-arm | |
env: | |
REGISTRY_IMAGE: ghcr.io/hyprmcp/mcp-gateway | |
steps: | |
- name: Login to GitHub Container Registry | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
- name: Generate Docker Metadata | |
id: meta | |
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
- name: Docker build (push only for tag) | |
id: build | |
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
platforms: ${{ matrix.platform.arch }} | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ env.REGISTRY_IMAGE }} | |
labels: ${{ steps.meta.outputs.labels }} | |
outputs: type=image,push-by-digest=true,name-canonical=true,push=${{ startsWith(github.ref, 'refs/tags/') }} | |
sbom: true | |
provenance: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Prepare for export | |
run: | | |
platform=${{ matrix.platform.arch }} | |
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
- name: Export digest | |
run: | | |
mkdir -p ${{ runner.temp }}/digests | |
digest="${{ steps.build.outputs.digest }}" | |
touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
- name: Upload digest | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: digests-${{ env.PLATFORM_PAIR }} | |
path: ${{ runner.temp }}/digests/* | |
if-no-files-found: error | |
retention-days: 1 | |
merge: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
env: | |
REGISTRY_IMAGE: ghcr.io/hyprmcp/mcp-gateway | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
with: | |
path: ${{ runner.temp }}/digests | |
pattern: digests-* | |
merge-multiple: true | |
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
- name: Create manifest list and push | |
working-directory: ${{ runner.temp }}/digests | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) | |
- name: Get digest of the created image | |
id: digest | |
run: | | |
DIGEST=$(docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} --format "{{ print .Manifest.Digest }}") | |
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" | |
- uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0 | |
- name: Sign the images with GitHub OIDC Token | |
env: | |
DIGEST: ${{ steps.digest.outputs.digest }} | |
TAGS: ${{ steps.meta.outputs.tags }} | |
run: | | |
images="" | |
for tag in ${TAGS}; do | |
images+="${tag}@${DIGEST} " | |
done | |
cosign sign --yes ${images} |