Skip to content

Merge pull request #3 from LynxSolutions/pcntl #60

Merge pull request #3 from LynxSolutions/pcntl

Merge pull request #3 from LynxSolutions/pcntl #60

Workflow file for this run

name: Build and push images
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0
push:
branches:
- main
paths:
- 'versions.json'
- '**/Dockerfile'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
DOCKER_REGISTRY: docker.io
DOCKER_REPOSITORY: lynxsolutions/php
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
generate-strategy:
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-strategy.outputs.strategy }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate Strategy
id: generate-strategy
run: |
EOF="EOF-$RANDOM-$RANDOM-$RANDOM"
echo "strategy<<$EOF" >> $GITHUB_OUTPUT
./generate-matrix-strategy.php | tee -a $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
build-and-push:
name: ${{ matrix.name }}
needs: generate-strategy
strategy: ${{ fromJson(needs.generate-strategy.outputs.strategy) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in (${{ env.DOCKER_REGISTRY }} registry)
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Build ${{ matrix.name }}
run: ${{ matrix.runs.build }}
- name: List Images
run: docker image ls | grep "$DOCKER_REPOSITORY"
- name: Push ${{ join(matrix.tags, ', ') }}
run: ${{ matrix.runs.push }}