name: Build and Push Docker Image on: push: branches: - main env: REGISTRY_HOST: gitea.gitea.svc.cluster.local:3000 REGISTRY_HTTP: http://gitea.gitea.svc.cluster.local:3000 IMAGE_NAME: ${{ gitea.repository }} jobs: build: permissions: contents: read packages: write runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: buildkitd-config-inline: | [registry."${{ env.REGISTRY_HOST }}"] http = true insecure = true - name: Log in to Gitea Container Registry shell: bash run: | echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ env.REGISTRY_HTTP }}" -u "${{ gitea.repository_owner }}" --password-stdin - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }} tags: | type=sha,prefix=,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push uses: docker/build-push-action@v6 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}