Skip to content

Commit 3688dcd

Browse files
authored
Merge pull request #146 from brefphp/docker-tag-patch-versions
Tag Docker images for patch versions too
2 parents be81207 + 7589647 commit 3688dcd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
# But the main use case is to release new layers when a release is created
77
release:
8-
types: [published]
8+
types: [ published ]
99

1010
# Necessary to deploy to AWS using OIDC
1111
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
@@ -26,6 +26,10 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v4
2828

29+
- name: Get the version
30+
id: get_version
31+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
32+
2933
# See https://stackoverflow.com/questions/70312490/github-actions-runner-environment-doesnt-build-for-arm-images
3034
- name: Set up QEMU to run ARM images (that were built with Depot)
3135
uses: docker/setup-qemu-action@v3
@@ -66,6 +70,7 @@ jobs:
6670
- run: make upload-to-docker-hub
6771
env:
6872
CPU: ${{ matrix.cpu }}
73+
DOCKER_TAG: ${{ steps.get_version.outputs.VERSION }}
6974

7075
update-layer-versions:
7176
name: Update layer versions in brefphp/bref

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,16 @@ upload-layers-php-%:
7272
# Publish Docker images to Docker Hub.
7373
upload-to-docker-hub: upload-to-docker-hub-php-80 upload-to-docker-hub-php-81 upload-to-docker-hub-php-82 upload-to-docker-hub-php-83
7474
upload-to-docker-hub-php-%:
75+
# Make sure we have defined the docker tag
76+
(test $(DOCKER_TAG)) && echo "Tagging images with \"${DOCKER_TAG}\"" || echo "You have to define environment variable DOCKER_TAG"
77+
test $(DOCKER_TAG)
78+
7579
for image in \
7680
"bref/${CPU_PREFIX}php-$*" "bref/${CPU_PREFIX}php-$*-fpm" "bref/${CPU_PREFIX}php-$*-console" \
7781
"bref/${CPU_PREFIX}build-php-$*" "bref/${CPU_PREFIX}php-$*-fpm-dev"; \
7882
do \
7983
docker tag $$image $$image:2 ; \
84+
docker tag $$image $$image:${DOCKER_TAG} ; \
8085
docker push $$image --all-tags ; \
8186
done
8287

0 commit comments

Comments
 (0)