| 10 |
name: Publish Docker image |
name: Publish Docker image |
| 11 |
|
|
| 12 |
on: |
on: |
| 13 |
schedule: |
push: |
| 14 |
# Run every day 05:10 UTC+8 |
branches: [ "milestone" ] |
| 15 |
- cron: '10 21 * * *' |
|
| 16 |
|
concurrency: |
| 17 |
|
group: ${{ github.workflow }}-${{ github.ref }} |
| 18 |
|
cancel-in-progress: true |
| 19 |
|
|
| 20 |
env: |
env: |
| 21 |
|
DOCKERHUB_PLATFORMS: linux/amd64,linux/arm64 |
| 22 |
|
SOLR_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-solr |
| 23 |
APACHE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-apache |
APACHE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-apache |
| 24 |
PHP_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-php |
PHP_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-php |
| 25 |
BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd |
BBSD_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/lbbs-bbsd |
| 49 |
username: ${{ secrets.DOCKERHUB_USERNAME }} |
username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 50 |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 51 |
|
|
| 52 |
- name: Extract metadata (tags, labels) for Docker |
- name: Set up QEMU |
| 53 |
id: meta |
uses: docker/setup-qemu-action@v3 |
| 54 |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 |
|
| 55 |
|
- name: Set up Docker Buildx |
| 56 |
|
uses: docker/setup-buildx-action@v3 |
| 57 |
|
|
| 58 |
|
- name: Extract Docker metadata (solr) |
| 59 |
|
id: meta-solr |
| 60 |
|
uses: docker/metadata-action@v5 |
| 61 |
with: |
with: |
| 62 |
images: leafok/lbbs |
images: ${{ env.APACHE_IMAGE }} |
| 63 |
|
|
| 64 |
- name: Build the Docker image (apache) |
- name: Extract Docker metadata (apache) |
| 65 |
uses: docker/build-push-action@v5 |
id: meta-apache |
| 66 |
|
uses: docker/metadata-action@v5 |
| 67 |
with: |
with: |
| 68 |
context: ./leafok_bbs |
images: ${{ env.APACHE_IMAGE }} |
|
file: ./leafok_bbs/Dockerfile/dockerfile.apache |
|
|
tags: | |
|
|
${{ env.APACHE_IMAGE }}:latest |
|
| 69 |
|
|
| 70 |
- name: Build the Docker image (php) |
- name: Extract Docker metadata (php) |
| 71 |
uses: docker/build-push-action@v5 |
id: meta-php |
| 72 |
|
uses: docker/metadata-action@v5 |
| 73 |
with: |
with: |
| 74 |
context: ./leafok_bbs |
images: ${{ env.PHP_IMAGE }} |
|
file: ./leafok_bbs/Dockerfile/dockerfile.php |
|
|
tags: | |
|
|
${{ env.PHP_IMAGE }}:latest |
|
| 75 |
|
|
| 76 |
- name: Build the Docker image (bbsd) |
- name: Extract Docker metadata (bbsd) |
| 77 |
|
id: meta-bbsd |
| 78 |
|
uses: docker/metadata-action@v5 |
| 79 |
|
with: |
| 80 |
|
images: ${{ env.PHP_IMAGE }} |
| 81 |
|
|
| 82 |
|
- name: Build the Docker image (solr) |
| 83 |
|
id: push-solr |
| 84 |
uses: docker/build-push-action@v5 |
uses: docker/build-push-action@v5 |
| 85 |
with: |
with: |
| 86 |
context: ./lbbs |
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 87 |
file: ./lbbs/Dockerfile/dockerfile.bbsd |
context: . |
| 88 |
|
file: Dockerfile/dockerfile.solr.testing |
| 89 |
|
push: true |
| 90 |
tags: | |
tags: | |
| 91 |
${{ env.BBSD_IMAGE }}:latest |
${{ env.SOLR_IMAGE }}:testing-${{ env.BUILD_DATE }} |
| 92 |
|
${{ env.SOLR_IMAGE }}:testing |
| 93 |
- name: Build the Docker image (apache:testing) |
${{ steps.meta-solr.outputs.tags }} |
| 94 |
|
labels: ${{ steps.meta-solr.outputs.labels }} |
| 95 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 96 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 97 |
|
|
| 98 |
|
- name: Build the Docker image (apache) |
| 99 |
id: push-apache |
id: push-apache |
| 100 |
uses: docker/build-push-action@v5 |
uses: docker/build-push-action@v5 |
| 101 |
with: |
with: |
| 102 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 103 |
context: . |
context: . |
| 104 |
file: Dockerfile/dockerfile.apache.testing |
file: Dockerfile/dockerfile.apache.testing |
| 105 |
push: true |
push: true |
| 106 |
tags: | |
tags: | |
| 107 |
${{ env.APACHE_IMAGE }}:testing-${{ env.BUILD_DATE }} |
${{ env.APACHE_IMAGE }}:testing-${{ env.BUILD_DATE }} |
| 108 |
${{ env.APACHE_IMAGE }}:testing |
${{ env.APACHE_IMAGE }}:testing |
| 109 |
labels: ${{ steps.meta.outputs.labels }} |
${{ steps.meta-apache.outputs.tags }} |
| 110 |
|
labels: ${{ steps.meta-apache.outputs.labels }} |
| 111 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 112 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 113 |
|
|
| 114 |
- name: Build the Docker image (php:testing) |
- name: Build the Docker image (php) |
| 115 |
id: push-php |
id: push-php |
| 116 |
uses: docker/build-push-action@v5 |
uses: docker/build-push-action@v5 |
| 117 |
with: |
with: |
| 118 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 119 |
context: . |
context: . |
| 120 |
file: Dockerfile/dockerfile.php.testing |
file: Dockerfile/dockerfile.php.testing |
| 121 |
push: true |
push: true |
| 122 |
tags: | |
tags: | |
| 123 |
${{ env.PHP_IMAGE }}:testing-${{ env.BUILD_DATE }} |
${{ env.PHP_IMAGE }}:testing-${{ env.BUILD_DATE }} |
| 124 |
${{ env.PHP_IMAGE }}:testing |
${{ env.PHP_IMAGE }}:testing |
| 125 |
labels: ${{ steps.meta.outputs.labels }} |
${{ steps.meta-php.outputs.tags }} |
| 126 |
|
labels: ${{ steps.meta-php.outputs.labels }} |
| 127 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 128 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |
| 129 |
|
|
| 130 |
- name: Build the Docker image (bbsd:testing) |
- name: Build the Docker image (bbsd) |
| 131 |
id: push-bbsd |
id: push-bbsd |
| 132 |
uses: docker/build-push-action@v5 |
uses: docker/build-push-action@v5 |
| 133 |
with: |
with: |
| 134 |
|
platforms: ${{ env.DOCKERHUB_PLATFORMS }} |
| 135 |
context: . |
context: . |
| 136 |
file: Dockerfile/dockerfile.bbsd.testing |
file: Dockerfile/dockerfile.bbsd.testing |
| 137 |
push: true |
push: true |
| 138 |
tags: | |
tags: | |
| 139 |
${{ env.BBSD_IMAGE }}:testing-${{ env.BUILD_DATE }} |
${{ env.BBSD_IMAGE }}:testing-${{ env.BUILD_DATE }} |
| 140 |
${{ env.BBSD_IMAGE }}:testing |
${{ env.BBSD_IMAGE }}:testing |
| 141 |
labels: ${{ steps.meta.outputs.labels }} |
${{ steps.meta-bbsd.outputs.tags }} |
| 142 |
|
labels: ${{ steps.meta-bbsd.outputs.labels }} |
| 143 |
|
cache-from: type=gha # Pull cache from GitHub Actions cache |
| 144 |
|
cache-to: type=gha,mode=max # Push cache to GitHub Actions cache |