diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index d5cdad0b7..5efac2429 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -15,7 +15,7 @@ jobs: platform: - linux/amd64 - linux/arm64 - # - linux/arm/v7 + # - linux/arm/v7 # Uncomment if you need ARMv7 support steps: - name: 📥 Checkout the git repo uses: actions/checkout@v4 @@ -36,13 +36,29 @@ jobs: type=sha,prefix=sha- type=ref,event=branch type=ref,event=pr - - name: 🏗️ Build Docker image uses: docker/build-push-action@v5 with: context: web/ platforms: ${{ matrix.platform }} - push: false + push: false # Only build, don't push to Docker Hub yet + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: 🔐 Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: 📤 Push Docker image to Docker Hub + uses: docker/build-push-action@v5 + with: + context: web/ + platforms: ${{ matrix.platform }} + push: true # Push to Docker Hub tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha