Skip to content

Build images nightly for unit testing #313

Build images nightly for unit testing

Build images nightly for unit testing #313

name: Build images nightly for unit testing
on:
workflow_dispatch:
schedule:
- cron: "30 2 * * *"
jobs:
push:
name: Build and push the latest test images
runs-on: ubuntu-22.04
strategy:
matrix:
phpVersion:
- "8.0"
- "8.1"
- "8.2"
# - "8"
steps:
- name: Check if secret is known
shell: bash
id: check
run: |
echo "skip=false" >> $GITHUB_OUTPUT
if [ -z "${{ secrets.DOCKER_HUB_TOKEN }}" ]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi
if [ -z "${{ secrets.DOCKER_HUB_USERNAME }}" ]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Checkout the app
uses: actions/checkout@v4
if: ${{ steps.check.outputs.skip == 'false' }}
- name: Make sure the appinfo is built
shell: bash
run: make appinfo/info.xml
if: ${{ steps.check.outputs.skip == 'false' }}
- name: Log into docker registry as user
shell: bash
run: >-
echo "${{ secrets.DOCKER_HUB_TOKEN }}"
| docker login
--username ${{ secrets.DOCKER_HUB_USERNAME }}
--password-stdin
- name: Install dependencies for runner
shell: bash
run: >-
cd .github/actions/run-tests &&
pip install -r requirements.txt
- name: Build and push the image
shell: bash
run: >-
cd .github/actions/run-tests &&
export COMPOSE_DOCKER_CLI_BUILD=1 &&
./run-locally.py
--pull
--create-images
--pull-php-base-image
--push-images
--php-version ${{ matrix.phpVersion }}
if: ${{ steps.check.outputs.skip == 'false' }}