| 3 |
on: |
on: |
| 4 |
push: |
push: |
| 5 |
branches: [ "main" ] |
branches: [ "main" ] |
| 6 |
pull_request: |
|
| 7 |
branches: [ "main" ] |
concurrency: |
| 8 |
|
group: ${{ github.workflow }}-${{ github.ref }} |
| 9 |
|
cancel-in-progress: true |
| 10 |
|
|
| 11 |
env: |
env: |
| 12 |
DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64 |
DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64 |
| 13 |
RUN_PLATFORM: linux/amd64 |
SOLR_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-solr |
| 14 |
|
APACHE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-apache |
| 15 |
|
PHP_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-php |
| 16 |
|
BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd |
| 17 |
|
|
| 18 |
jobs: |
jobs: |
| 19 |
|
|
| 28 |
submodules: recursive |
submodules: recursive |
| 29 |
fetch-depth: 0 # fetch all history if the action needs it |
fetch-depth: 0 # fetch all history if the action needs it |
| 30 |
|
|
| 31 |
- name: Build images |
- name: Log in to Docker Hub |
| 32 |
# Build images and run containers in detached mode |
uses: docker/login-action@v3 |
| 33 |
run: sh -x build.sh |
with: |
| 34 |
|
username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 35 |
|
password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 36 |
|
|
| 37 |
|
- name: Set up QEMU |
| 38 |
|
uses: docker/setup-qemu-action@v3 |
| 39 |
|
|
| 40 |
|
- name: Set up Docker Buildx |
| 41 |
|
uses: docker/setup-buildx-action@v3 |
| 42 |
|
|
| 43 |
|
- name: Extract Docker metadata (solr) |
| 44 |
|
id: meta-solr |
| 45 |
|
uses: docker/metadata-action@v5 |
| 46 |
|
with: |
| 47 |
|
images: ${{ env.SOLR_IMAGE }} |
| 48 |
|
|
| 49 |
|
- name: Extract Docker metadata (apache) |
| 50 |
|
id: meta-apache |
| 51 |
|
uses: docker/metadata-action@v5 |
| 52 |
|
with: |
| 53 |
|
images: ${{ env.APACHE_IMAGE }} |
| 54 |
|
|
| 55 |
|
- name: Extract Docker metadata (php) |
| 56 |
|
id: meta-php |
| 57 |
|
uses: docker/metadata-action@v5 |
| 58 |
|
with: |
| 59 |
|
images: ${{ env.PHP_IMAGE }} |
| 60 |
|
|
| 61 |
|
- name: Extract Docker metadata (bbsd) |
| 62 |
|
id: meta-bbsd |
| 63 |
|
uses: docker/metadata-action@v5 |
| 64 |
|
with: |
| 65 |
|
images: ${{ env.BBSD_IMAGE }} |
| 66 |
|
|
| 67 |
|
- name: Build the Docker image (solr) |
| 68 |
|
id: build-solr |
| 69 |
|
uses: docker/build-push-action@v5 |
| 70 |
|
with: |
| 71 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 72 |
|
context: . |
| 73 |
|
file: Dockerfile/dockerfile.solr.testing |
| 74 |
|
tags: | |
| 75 |
|
${{ steps.meta-solr.outputs.tags }} |
| 76 |
|
labels: ${{ steps.meta-solr.outputs.labels }} |
| 77 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 78 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 79 |
|
|
| 80 |
|
- name: Build the Docker image (apache) |
| 81 |
|
id: build-apache |
| 82 |
|
uses: docker/build-push-action@v5 |
| 83 |
|
with: |
| 84 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 85 |
|
context: . |
| 86 |
|
file: Dockerfile/dockerfile.apache.testing |
| 87 |
|
tags: | |
| 88 |
|
${{ steps.meta-apache.outputs.tags }} |
| 89 |
|
labels: ${{ steps.meta-apache.outputs.labels }} |
| 90 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 91 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 92 |
|
|
| 93 |
|
- name: Build the Docker image (php) |
| 94 |
|
id: build-php |
| 95 |
|
uses: docker/build-push-action@v5 |
| 96 |
|
with: |
| 97 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 98 |
|
context: . |
| 99 |
|
file: Dockerfile/dockerfile.php.testing |
| 100 |
|
tags: | |
| 101 |
|
${{ steps.meta-php.outputs.tags }} |
| 102 |
|
labels: ${{ steps.meta-php.outputs.labels }} |
| 103 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 104 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 105 |
|
|
| 106 |
|
- name: Build the Docker image (bbsd) |
| 107 |
|
id: build-bbsd |
| 108 |
|
uses: docker/build-push-action@v5 |
| 109 |
|
with: |
| 110 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 111 |
|
context: . |
| 112 |
|
file: Dockerfile/dockerfile.bbsd.testing |
| 113 |
|
tags: | |
| 114 |
|
${{ steps.meta-bbsd.outputs.tags }} |
| 115 |
|
labels: ${{ steps.meta-bbsd.outputs.labels }} |
| 116 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 117 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |