diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml new file mode 100644 index 0000000..26d0e55 --- /dev/null +++ b/.gitea/workflows/docker-build.yaml @@ -0,0 +1,46 @@ +--- +name: gds-mock-mcp Docker Build +on: + push: + branches: [main] + tags: [v*] + pull_request: + branches: [main] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Installs QEMU binaries for multi-platform emulation. + uses: docker/setup-qemu-action@v4 + - name: Generates image tags and annotations from Git information. + id: meta + uses: docker/metadata-action@v6 + with: + images: registry.mortons.site/gds-mock-mcp + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + type=ref,event=pr + type=sha + - name: Login to registry + if: ${{ gitea.event_name != 'pull_request' }} + uses: docker/login-action@v4 + with: + registry: registry.mortons.site + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Configures a Docker Buildx builder instance. + uses: docker/setup-buildx-action@v4 + - name: Builds and pushes the Docker image using the Buildx environment. + uses: docker/bake-action@v7 + with: + push: ${{ gitea.event_name != 'pull_request' }} + files: | + ./docker/docker-bake.hcl + cwd://${{ steps.meta.outputs.bake-file }} + targets: build