diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..945170d --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,48 @@ +name: Build and publish Docker image + +on: + release: + types: [published] + +env: + REGISTRY: gitea.kanawave.net + REGISTRY_USERNAME: sebastas + IMAGE_NAME: ${{ gitea.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + + # Permissions are not yet supported in Gitea Actions -> https://github.com/go-gitea/gitea/issues/23642#issuecomment-2119876692 + # permissions: + # contents: read + # packages: write + # attestations: write + # id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push + id: push + uses: docker/build-push-action@v6 + with: + context: . + # file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}