Merge pull request #279 from roundcube/fix-pushing-nightly #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Publish | |
permissions: | |
contents: read | |
on: | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- 'README.md' | |
- 'examples/**' | |
tags: | |
- '1.6.*' | |
schedule: | |
# Rebuild images each monday early morning to ensure a fresh base OS. | |
- cron: "23 2 * * 1" | |
jobs: | |
build-and-testvariants: | |
name: Build image variants and run tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
include: | |
- variant: 'apache' | |
test-files: 'apache-postgres' | |
docker-tag: roundcube/roundcubemail:1.6.x-apache,roundcube/roundcubemail:1.6.9-apache,roundcube/roundcubemail:latest-apache,roundcube/roundcubemail:latest | |
test-tag: roundcube/roundcubemail:latest-apache | |
- variant: 'fpm' | |
test-files: 'fpm-postgres' | |
docker-tag: roundcube/roundcubemail:1.6.x-fpm,roundcube/roundcubemail:1.6.9-fpm,roundcube/roundcubemail:latest-fpm | |
test-tag: roundcube/roundcubemail:latest-fpm | |
- variant: 'fpm-alpine' | |
test-files: 'fpm-postgres' | |
docker-tag: roundcube/roundcubemail:1.6.x-fpm-alpine,roundcube/roundcubemail:1.6.9-fpm-alpine,roundcube/roundcubemail:latest-fpm-alpine | |
test-tag: roundcube/roundcubemail:latest-fpm-alpine | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get docker hub username | |
id: creds | |
run: echo '::set-output name=username::${{ secrets.DOCKER_PULL_USERNAME }}' | |
- name: Login to Docker Hub | |
if: steps.creds.outputs.username != '' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_PULL_USERNAME }} | |
password: ${{ secrets.DOCKER_PUSH_PASSWORD }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
buildkitd-flags: --debug | |
- name: Build and push image for "${{ matrix.variant }}" | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.variant }} | |
platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le,linux/386,linux/amd64," | |
push: true | |
tags: ${{ matrix.docker-tag }} | |
# does not work linux/arm/v5 AND linux/mips64le - composer does not support mips64le or armv5 nor does the php image support them on the alpine variant | |
- name: Run tests | |
env: | |
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.test-tag }} | |
run: | | |
set -exu; | |
for testFile in ${{ join(matrix.test-files, ' ') }}; | |
do | |
docker compose -f ./tests/docker-compose.test-${testFile}.yml \ | |
up --exit-code-from=sut --abort-on-container-exit | |
done |