name: Docker Image CI on: push: branches: ['main'] pull_request: branches: ['main'] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Buildx uses: docker/setup-buildx-action@v3 - name: Login to Container Registry if: gitea.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: git.jamsch0.dev username: ${{gitea.actor}} password: ${{secrets.CI_TOKEN}} - name: Extract metadata uses: docker/metadata-action@v5 id: meta with: images: git.jamsch0.dev/jamsch0/groceries tags: type=raw,value=latest,enable={{is_default_branch}} - name: Build and push uses: docker/build-push-action@v6 with: context: . cache-from: type=gha cache-to: type=gha,mode=max push: ${{gitea.event_name != 'pull_request'}} tags: ${{steps.meta.outputs.tags}} labels: ${{steps.meta.outputs.labels}}