Skip to content

Build

Build #57

Workflow file for this run

name: Build
env:
PERIODIC_UPDATES_MIN_VERSION: 8.2
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/hiqdev/docker-ci-images/php-nginx
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:
- 'php-nginx/**'
-
id: generate-jobs
name: Generate Jobs
run: |
strategy="$(./scripts/generate-actions.sh ${{ github.event_name }} '${{ steps.changes.outputs.version_files }}' "${PERIODIC_UPDATES_MIN_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 Docker registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:php-nginx/${{ matrix.php }}"
tags: "${{ env.IMAGE_NAME }}:${{ matrix.php}}"
push: ${{ github.event_name != 'pull_request' }}