diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d5f9f14..ca9d91a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index dbdb615..7d02bdb 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,10 @@ on: push: branches: [ "milestone" ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64 SOLR_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-solr @@ -51,6 +55,30 @@ jobs: - 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.APACHE_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.PHP_IMAGE }} + - name: Build the Docker image (solr) id: push-solr uses: docker/build-push-action@v5 @@ -62,7 +90,10 @@ jobs: tags: | ${{ env.SOLR_IMAGE }}:testing-${{ env.BUILD_DATE }} ${{ env.SOLR_IMAGE }}:testing - labels: ${{ steps.meta.outputs.labels }} + ${{ 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: push-apache @@ -75,7 +106,10 @@ jobs: tags: | ${{ env.APACHE_IMAGE }}:testing-${{ env.BUILD_DATE }} ${{ env.APACHE_IMAGE }}:testing - labels: ${{ steps.meta.outputs.labels }} + ${{ 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: push-php @@ -88,7 +122,10 @@ jobs: tags: | ${{ env.PHP_IMAGE }}:testing-${{ env.BUILD_DATE }} ${{ env.PHP_IMAGE }}:testing - labels: ${{ steps.meta.outputs.labels }} + ${{ 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: push-bbsd @@ -101,4 +138,7 @@ jobs: tags: | ${{ env.BBSD_IMAGE }}:testing-${{ env.BUILD_DATE }} ${{ env.BBSD_IMAGE }}:testing - labels: ${{ steps.meta.outputs.labels }} + ${{ 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 diff --git a/docker-compose.yml b/docker-compose.yml index 4d1fc7b..ebc4c06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,7 @@ services: - /opt/solr/server/solr/configsets/lbbs networks: - app-network + mem_limit: 512M apache: image: leafok/lbbs-apache:testing diff --git a/lbbs b/lbbs index b81d4f0..ac14398 160000 --- a/lbbs +++ b/lbbs @@ -1 +1 @@ -Subproject commit b81d4f011035082ebedd5404b9f24f22c19f8975 +Subproject commit ac1439804f4b02e2abdfb595da9ee690c6e433ae diff --git a/leafok_bbs b/leafok_bbs index 6540c69..8c656f7 160000 --- a/leafok_bbs +++ b/leafok_bbs @@ -1 +1 @@ -Subproject commit 6540c699fd5595788752a09bace74ed2ca412c5d +Subproject commit 8c656f7c6268e88f088e96f07b288f30d3a28518