Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 95 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
48 changes: 44 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
- /opt/solr/server/solr/configsets/lbbs
networks:
- app-network
mem_limit: 512M

apache:
image: leafok/lbbs-apache:testing
Expand Down
2 changes: 1 addition & 1 deletion leafok_bbs