From f90918b8d34fdc0a6497b7cd5953e7e8f6766494 Mon Sep 17 00:00:00 2001 From: tygozwolle <1+tygozwolle@noreply.localhost> Date: Fri, 24 Jul 2026 12:37:30 +0200 Subject: [PATCH] Add .gitea/ workflows/build.yml --- .gitea/ workflows/build.yml | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .gitea/ workflows/build.yml diff --git a/ .gitea/ workflows/build.yml b/ .gitea/ workflows/build.yml new file mode 100644 index 0000000..88f8175 --- /dev/null +++ b/ .gitea/ workflows/build.yml @@ -0,0 +1,54 @@ +name: Build and Push Docker Image to Gitea Container Registry + +on: + workflow_dispatch: + push: + # branches: + # - master + # - main + # tags: + # - 'v*' + pull_request: + branches: + - master + - main + +env: + REGISTRY: cablon.vanolst.tech + IMAGE_NAME: ${{ gitea.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Gitea Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ gitea.actor }} + password: ${{ secrets.PACKAGEKEY }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} + type=ref,event=branch + type=ref,event=tag + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}