Skip to content

Build

Build #142

Workflow file for this run

name: Build
env:
PERIODIC_UPDATES_MIN_VERSION: 7.4
MIN_SUPPORTED_VERSION: 7.3
on:
pull_request:
workflow_dispatch:
push:
branches:
- 'master'
schedule:
- cron: 0 1 * * 0
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
if: ${{ github.event_name != 'schedule' }}
id: changes
with:
list-files: json
filters: |
version:
- 'src/**'
- id: generate-jobs
name: Generate Jobs
run: |
strategy="$(./scripts/generate-actions.sh ${{ github.event_name }} '${{ steps.changes.outputs.version_files }}' "${PERIODIC_UPDATES_MIN_VERSION}" "${MIN_SUPPORTED_VERSION}")"
jq . <<<"$strategy" # sanity check / debugging aid
echo "strategy=$strategy" >> $GITHUB_OUTPUT
build:
needs: generate-jobs
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: build-name
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:src/${{ matrix.php }}/${{ matrix.tag }}"
tags: "hiqdev/php:${{ matrix.php}}-${{ matrix.tag }}"
push: ${{ github.event_name != 'pull_request' }}