Skip to content

Commit 5092ae1

Browse files
committed
Merge branch 'php8dot2' into php8dot2-mongodb
2 parents 03bd974 + 11cab81 commit 5092ae1

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/docker-build.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches: ["master", "php*"]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to Docker Hub
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
packages: write
14+
contents: read
15+
16+
steps:
17+
- name: Check out the repo
18+
uses: actions/checkout@v4
19+
20+
- name: Log in to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@v5
29+
with:
30+
images: lojassimonetti/php-apache-oci8-composer
31+
32+
- name: Should push?
33+
id: shoudPush
34+
run: |
35+
if [[ ${{ github.event.ref }} =~ ^refs/heads/php[0-9]dot[0-9]$ ]]; then
36+
echo "match=true" >> $GITHUB_OUTPUT
37+
elif [[ ${{ github.event.ref }} = "refs/heads/master" ]]; then
38+
echo "match=true" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v5
43+
with:
44+
context: .
45+
push: ${{ steps.shoudPush.outputs.match == 'true' }}
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)