--- lbbs/.github/workflows/docker-image.yml 2026/01/05 12:15:08 1.1 +++ lbbs/.github/workflows/docker-image.yml 2026/01/24 15:26:22 1.5 @@ -3,8 +3,14 @@ name: Docker Image CI on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] + +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 +21,33 @@ jobs: steps: - uses: actions/checkout@v4 + - 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 + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.BBSD_IMAGE }} + - name: Build the Docker image - run: docker build . --file Dockerfile/dockerfile.bbsd --tag lbbs-bbsd:$(date +%s) + id: build-bbsd + uses: docker/build-push-action@v5 + with: + platforms: ${{ env.DOCKERHUB_PLATFORMS }} + context: . + file: Dockerfile/dockerfile.bbsd + tags: | + ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha # Pull cache from GitHub Actions cache + cache-to: type=gha,mode=max # Push cache to GitHub Actions cache