--- 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: Use Node.js uses: actions/setup-node@v4 with: node-version: 20.x - run: npm ci - run: npm run build --if-present - name: Installs QEMU binaries for multi-platform emulation. uses: docker/setup-qemu-action@v4 with: cache-image: true - 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: default