From 9b4d8f5d2045f5c747c988806622eb243a4b9967 Mon Sep 17 00:00:00 2001 From: H-T-H <67087346+H-T-H@users.noreply.github.com> Date: Wed, 1 Jan 2025 20:58:19 +0800 Subject: [PATCH] Create docker-image.yml --- .github/workflows/docker-image.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..9b34af6 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,33 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Extract Docker image metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ vars.DOCKER_USERNAME }}/Gemini-Telegram-Bot + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + annotations: ${{ steps.meta.outputs.annotations }}