--- lbbs/.github/workflows/docker-image.yml 2026/01/05 12:15:08 1.1 +++ lbbs/.github/workflows/docker-image.yml 2026/01/28 14:39:57 1.6 @@ -2,9 +2,16 @@ name: Docker Image CI on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + branches: + - "v*.*" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64 + BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd jobs: @@ -15,5 +22,33 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile/dockerfile.bbsd --tag lbbs-bbsd:$(date +%s) + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract Docker metadata (bbsd) + id: meta-bbsd + uses: docker/metadata-action@v5 + with: + images: ${{ env.BBSD_IMAGE }} + + - name: Build the Docker image (bbsd) + id: build-bbsd + uses: docker/build-push-action@v5 + with: + platforms: ${{ env.DOCKERHUB_PLATFORMS }} + context: . + file: Dockerfile/dockerfile.bbsd + tags: | + ${{ steps.meta-bbsd.outputs.tags }} + labels: ${{ steps.meta-bbsd.outputs.labels }} + cache-from: type=gha # Pull cache from GitHub Actions cache + cache-to: type=gha,mode=max # Push cache to GitHub Actions cache