Skip to content

Tag with versions

Tag with versions #3

Workflow file for this run

name: Tag actual PHP versions
on:
workflow_dispatch:
branches: [ 8.4 ]
env:
PHP_VERSION: 8.4
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
tag:
name: Tag actual PHP versions
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get the PHP version
id: php_version
env:
PHP_VERSION: ${{ env.PHP_VERSION }}
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PHP_VERSION }}
run: |
echo "actual_version=$(docker run --rm --entrypoint sh ${IMAGE} -c 'php -v | head -n 1 | cut -d " " -f 2')" >> "$GITHUB_OUTPUT"
- name: Tag the image with the actual PHP version
env:
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PHP_VERSION }}
ACTUAL_VERSION: ${{ steps.php_version.outputs.actual_version }}
run: |
docker tag ${IMAGE} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${ACTUAL_VERSION}