Add manual workflow to trigger release image #14
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: Code tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
changed-files: | |
name: Detect changed files | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
outputs: | |
ci: ${{ steps.changes.outputs.ci }} | |
composer: ${{ steps.changes.outputs.composer }} | |
php: ${{ steps.changes.outputs.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check for file changes | |
uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: .github/file-filters.yml | |
composer-validation: | |
if: needs.changed-files.outputs.composer == 'true' | |
needs: | |
- changed-files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
tests: | |
if: needs.changed-files.outputs.php == 'true' | |
needs: | |
- changed-files | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: xml | |
- name: Run syntax check | |
run: ./scripts/cibuild.sh | |
docker-build: | |
if: | | |
github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && | |
needs.changed-files.outputs.composer == 'true' && needs.changed-files.outputs.php == 'true' | |
needs: | |
- composer-validation | |
- changed-files | |
- tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ github.repository }}:bleeding-edge | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |