From d6e0b7be18b1d736b95565743534fa53c08a0fed Mon Sep 17 00:00:00 2001 From: Egor Date: Thu, 15 Jan 2026 19:23:28 +0300 Subject: [PATCH] Create docker-hub.yml --- .github/workflows/docker-hub.yml | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/docker-hub.yml diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml new file mode 100644 index 0000000..5ed2a26 --- /dev/null +++ b/.github/workflows/docker-hub.yml @@ -0,0 +1,52 @@ +name: Docker Hub Build + +on: + push: + branches: [main] + tags: + - 'v*' + +jobs: + build-and-push-dockerhub: + 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 Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/bedolaga-cabinet + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push to Docker Hub + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + VITE_API_URL=/api + VITE_TELEGRAM_BOT_USERNAME= + VITE_APP_NAME=Bedolaga Cabinet + VITE_APP_LOGO=V + platforms: linux/amd64,linux/arm64