From b0432210e6d3e02458ca11e60990e6e63a3389dd Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Mon, 5 Jan 2026 17:58:58 +0100 Subject: [PATCH] Add Gitea actions --- .gitea/workflows/build.yaml | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..db7f01b --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,65 @@ +name: Build and Push Docker Image + +on: + push: + tags: + - '*' + branches: + - main + - dev + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io + + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set Kubernetes Context + uses: azure/k8s-set-context@v4 + with: + method: kubeconfig + kubeconfig: ${{secrets.buildx_kubeconfig}} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: kubernetes + driver-opts: | + namespace=gitea + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: git.coopgo.io + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker image + id: metadata + uses: docker/metadata-action@v3 + with: + images: git.coopgo.io/${{gitea.repository}} + tags: | + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + flavor: | + latest=auto + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ${{ steps.metadata.outputs.tags }} + build-args: | + ACCESS_TOKEN_USR=${{gitea.actor}} + ACCESS_TOKEN_PWD=${{gitea.token}}