name: Build and Push Docker Image on: push: branches: [main] tags: ["v*"] pull_request: branches: [main] workflow_dispatch: jobs: build: runs-on: node-22-bookworm steps: - name: Checkout repository uses: https://github.com/actions/checkout@v3 - name: Set up QEMU uses: https://github.com/docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v2 - name: Log in to GitHub Container Registry if: github.event_name != 'pull_request' uses: https://github.com/docker/login-action@v2 with: registry: git.nokiy.net username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract Docker metadata id: meta uses: https://github.com/docker/metadata-action@v4 with: images: git.nokiy.net/reonokiy/sing-box-reality-server tags: | type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=sha,format=short - name: Build and push Docker image uses: https://github.com/docker/build-push-action@v4 with: context: templates/sing-box-reality-server platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max