From f38bf5f914445be07041b8f29a6b24cbe0362c04 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Tue, 9 Apr 2024 09:38:04 +0200 Subject: [PATCH] git action added --- .../docker-community-push-latest.yml | 31 +++++++++++++ .../docker-image-tag-community-tag-push.yml | 44 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/docker-community-push-latest.yml create mode 100644 .github/workflows/docker-image-tag-community-tag-push.yml diff --git a/.github/workflows/docker-community-push-latest.yml b/.github/workflows/docker-community-push-latest.yml new file mode 100644 index 0000000..7786ba8 --- /dev/null +++ b/.github/workflows/docker-community-push-latest.yml @@ -0,0 +1,31 @@ +name: Docker Image Backend LLM Community latest CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: tiledesk/tiledesk-backend-llm + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: tiledesk/tiledesk-backend-llm:latest diff --git a/.github/workflows/docker-image-tag-community-tag-push.yml b/.github/workflows/docker-image-tag-community-tag-push.yml new file mode 100644 index 0000000..fd5309c --- /dev/null +++ b/.github/workflows/docker-image-tag-community-tag-push.yml @@ -0,0 +1,44 @@ +name: Docker Image Backend LLM Community latest CI + +env: + REGISTRY: tiledesk + IMAGE_NAME: tiledesk-backend-llm + +on: + push: + tags: + - '**' # Push events to every tag including hierarchical tags like +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tag_with_ref: true + + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }}