From 76aa6e4b2da3cd8ce0f55abeea157c70583a0ed1 Mon Sep 17 00:00:00 2001 From: Tygozwolle Date: Fri, 24 Jul 2026 11:22:05 +0200 Subject: [PATCH] feat: add Gitea Actions workflow to build and push Docker image to registry --- .gitea/workflows/build-and-push.yml | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .gitea/workflows/build-and-push.yml diff --git a/.gitea/workflows/build-and-push.yml b/.gitea/workflows/build-and-push.yml new file mode 100644 index 0000000..93c0fec --- /dev/null +++ b/.gitea/workflows/build-and-push.yml @@ -0,0 +1,56 @@ +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 + type=sha,prefix=sha- + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./radiuscontroller/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}