Skip to content

Commit 72d4414

Browse files
committed
Add tag version based on dockerfile
1 parent 3ce6c96 commit 72d4414

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/publish_docker.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
workflow_dispatch:
8-
inputs:
9-
tag:
10-
description: "Image tag (e.g. 8.2-2.2)"
11-
required: true
12-
default: latest
137

148
jobs:
159
build:
@@ -33,11 +27,17 @@ jobs:
3327
username: ${{ github.actor }}
3428
password: ${{ secrets.GITHUB_TOKEN }}
3529

30+
- name: Extract versions
31+
id: vars
32+
run: |
33+
php=$(grep 'ARG PHP_VERSION' Dockerfile | cut -d= -f2)
34+
composer=$(grep 'ARG COMPOSER_VERSION' Dockerfile | cut -d= -f2)
35+
echo "tag=$php-$composer" >> $GITHUB_OUTPUT
36+
3637
- name: Build and push multi-arch image
3738
uses: docker/build-push-action@v6
3839
with:
3940
context: .
4041
push: true
4142
platforms: linux/amd64,linux/arm64
42-
tags: |
43-
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}
43+
tags: ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:22.04
33
ARG DEBIAN_FRONTEND=noninteractive
44

55
# Allow PHP version and composer version to be overriden
6-
ARG PHP_VERSION=8.2
6+
ARG PHP_VERSION=8.2.29
77
ARG COMPOSER_VERSION=2.2
88

99
ENV LANG=en_US.UTF-8 \

0 commit comments

Comments
 (0)