--- lbbs-combo/.github/workflows/docker-image.yml 2026/01/09 11:16:28 1.3 +++ lbbs-combo/.github/workflows/docker-image.yml 2026/01/24 15:27:48 1.4 @@ -3,12 +3,17 @@ 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 - RUN_PLATFORM: linux/amd64 + SOLR_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-solr + APACHE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-apache + PHP_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-php + BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd jobs: @@ -23,6 +28,90 @@ jobs: submodules: recursive fetch-depth: 0 # fetch all history if the action needs it - - name: Build images - # Build images and run containers in detached mode - run: sh -x build.sh + - 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 (solr) + id: meta-solr + uses: docker/metadata-action@v5 + with: + images: ${{ env.SOLR_IMAGE }} + + - name: Extract Docker metadata (apache) + id: meta-apache + uses: docker/metadata-action@v5 + with: + images: ${{ env.APACHE_IMAGE }} + + - name: Extract Docker metadata (php) + id: meta-php + uses: docker/metadata-action@v5 + with: + images: ${{ env.PHP_IMAGE }} + + - name: Extract Docker metadata (bbsd) + id: meta-bbsd + uses: docker/metadata-action@v5 + with: + images: ${{ env.BBSD_IMAGE }} + + - name: Build the Docker image (solr) + id: build-solr + uses: docker/build-push-action@v5 + with: + platforms: ${{ env.DOCKERHUB_PLATFORMS }} + context: . + file: Dockerfile/dockerfile.solr.testing + tags: | + ${{ steps.meta-solr.outputs.tags }} + labels: ${{ steps.meta-solr.outputs.labels }} + cache-from: type=gha # Pull cache from GitHub Actions cache + cache-to: type=gha,mode=max # Push cache to GitHub Actions cache + + - name: Build the Docker image (apache) + id: build-apache + uses: docker/build-push-action@v5 + with: + platforms: ${{ env.DOCKERHUB_PLATFORMS }} + context: . + file: Dockerfile/dockerfile.apache.testing + tags: | + ${{ steps.meta-apache.outputs.tags }} + labels: ${{ steps.meta-apache.outputs.labels }} + cache-from: type=gha # Pull cache from GitHub Actions cache + cache-to: type=gha,mode=max # Push cache to GitHub Actions cache + + - name: Build the Docker image (php) + id: build-php + uses: docker/build-push-action@v5 + with: + platforms: ${{ env.DOCKERHUB_PLATFORMS }} + context: . + file: Dockerfile/dockerfile.php.testing + tags: | + ${{ steps.meta-php.outputs.tags }} + labels: ${{ steps.meta-php.outputs.labels }} + cache-from: type=gha # Pull cache from GitHub Actions cache + cache-to: type=gha,mode=max # Push cache to GitHub Actions cache + + - 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.testing + 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