From a4bcb782957783a2723fb09973ed4beed605991d Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Wed, 22 Oct 2025 07:09:46 +0300 Subject: [PATCH] add docker pub --- .gitea/workflows/publish-docker.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitea/workflows/publish-docker.yml diff --git a/.gitea/workflows/publish-docker.yml b/.gitea/workflows/publish-docker.yml new file mode 100644 index 0000000..73e8117 --- /dev/null +++ b/.gitea/workflows/publish-docker.yml @@ -0,0 +1,48 @@ +name: Publish Docker Image + +on: + push: + branches: + - master + +jobs: + publish: + name: Build and Publish to Harbor + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Harbor + uses: docker/login-action@v3 + with: + registry: harbor.home + username: robot$chatbot + password: ${{ secrets.HARBOR_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: harbor.home/chatbot/chatbot + tags: | + type=ref,event=branch + type=sha,prefix={{branch}}- + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ./ChatBot + file: ./ChatBot/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=harbor.home/chatbot/chatbot:buildcache + cache-to: type=registry,ref=harbor.home/chatbot/chatbot:buildcache,mode=max + + - name: Image digest + run: echo "Image published with digest ${{ steps.build.outputs.digest }}" -- 2.49.1