From 768359ad62c504c79d30a73b8d17f334422047d8 Mon Sep 17 00:00:00 2001 From: Sebastian Slettebakken <43045439+sebastas@users.noreply.github.com> Date: Thu, 13 Nov 2025 03:42:19 +0100 Subject: [PATCH] feat: add Gitea Actions workflow for building and publishing Docker image to registry --- .gitea/workflows/publish.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitea/workflows/publish.yaml diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..091176e --- /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@v4 + + - name: Login to registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push + id: push + uses: docker/build-push-action@v5 + with: + context: . + # file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}