From b709d48f8f488c090addc18b0fb5a7eed735c2f2 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Tue, 14 Jul 2026 11:05:04 +0200 Subject: [PATCH] feat(workflows): add workflow for building docker images --- .gitea/workflows/docker-build-push.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitea/workflows/docker-build-push.yml diff --git a/.gitea/workflows/docker-build-push.yml b/.gitea/workflows/docker-build-push.yml new file mode 100644 index 0000000..c14cef5 --- /dev/null +++ b/.gitea/workflows/docker-build-push.yml @@ -0,0 +1,57 @@ +name: Build and Push Docker Image + +on: + workflow_call: + inputs: + image_name: + required: true + type: string + + docker_context: + required: false + type: string + default: "." + + dockerfile: + required: false + type: string + default: "Dockerfile" + + tag: + required: false + type: string + default: "develop" + + secrets: + REGISTRY_USER: + required: true + + REGISTRY_TOKEN: + required: true + +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 + uses: docker/login-action@v3 + with: + registry: git.itlab-ffeks.dnu.edu.ua + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ inputs.docker_context }} + file: ${{ inputs.dockerfile }} + push: true + tags: | + git.itlab-ffeks.dnu.edu.ua/${{ gitea.repository_owner }}/${{ inputs.image_name }}:${{ inputs.tag }} \ No newline at end of file