Merge pull request #27 from DeltaRule/copilot/update-pvc-to-local-path #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds and pushes all DeltaDatabase Docker images to Docker Hub. | |
| # | |
| # Tag scheme (Python-style — qualifier first, short variant after the dash): | |
| # | |
| # latest-main — Main Worker, rolling build from the main branch | |
| # latest-proc — Proc Worker, rolling build from the main branch | |
| # latest-aio — All-in-One, rolling build from the main branch | |
| # v0.1.1-alpha-main — Main Worker, pinned to the v0.1.1-alpha release tag | |
| # v0.1.1-alpha-proc — Proc Worker, pinned to the v0.1.1-alpha release tag | |
| # v0.1.1-alpha-aio — All-in-One, pinned to the v0.1.1-alpha release tag | |
| # | |
| # Triggers: | |
| # • Every push / merge to the `main` branch → pushes latest-* tags | |
| # • Every version tag push (v*) → additionally pushes <version>-* tags | |
| # | |
| # Required repository configuration: | |
| # vars.DOCKERHUB_USERNAME — Docker Hub username (e.g. donti) | |
| # secrets.DOCKERHUB_TOKEN — Docker Hub access token (read/write) | |
| name: Docker Hub Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| jobs: | |
| docker: | |
| name: Build & push ${{ matrix.variant }} | |
| runs-on: self-hosted | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - dockerfile: deploy/docker/Dockerfile.main-worker | |
| variant: main | |
| - dockerfile: deploy/docker/Dockerfile.proc-worker | |
| variant: proc | |
| - dockerfile: deploy/docker/Dockerfile.all-in-one | |
| variant: aio | |
| steps: | |
| - name: Checkout | |
| 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: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Compute image tags | |
| id: tags | |
| run: | | |
| IMAGE="${{ vars.DOCKERHUB_USERNAME }}/deltadatabase" | |
| VARIANT="${{ matrix.variant }}" | |
| # Rolling "latest" tag — qualifier first, then short variant name. | |
| # e.g. latest-main | latest-proc | latest-aio | |
| TAGS="${IMAGE}:latest-${VARIANT}" | |
| # When triggered by a version tag (v*), also push a pinned release tag. | |
| # e.g. v0.1.1-alpha-main | v0.1.1-alpha-proc | v0.1.1-alpha-aio | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| TAGS="${TAGS},${IMAGE}:${VERSION}-${VARIANT}" | |
| fi | |
| echo "tags=${TAGS}" >> "${GITHUB_OUTPUT}" | |
| - name: Build and push ${{ matrix.variant }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| tags: ${{ steps.tags.outputs.tags }} | |
| cache-from: type=gha,scope=${{ matrix.variant }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.variant }} |