Skip to content

Commit a7ccb04

Browse files
author
Felipe Almeida Baccaro
committed
fixing image name structure on file versions.json and removing versioning.sh adding code directly on docker-image.yml.
1 parent ef2ea98 commit a7ccb04

3 files changed

Lines changed: 48 additions & 20 deletions

File tree

‎.github/workflows/docker-image.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Docker build and push"
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
jobs:
6+
build_images:
7+
name: "Building Images."
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- run: |
11+
jq -r 'map(select(.build == true)).[]
12+
| .stages[] as $stage
13+
| "docker build --no-cache --target \($stage) -t \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) ./\(.path) "
14+
| split("\n") | .[]' versions.json | while read -r image; do
15+
$($image)
16+
done
17+
docker_login:
18+
name: "Login Docker."
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
docker_push:
27+
name: "Pushing images to docker hub."
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- run: |
31+
jq -r 'map(select(.build == true and .push == true)).[]
32+
| .stages[] as $stage
33+
| "docker push \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) "
34+
| split("\n") | .[]' versions.json | while read -r image; do
35+
$($image)
36+
done

‎versioning.sh‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎versions.json‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
[
22
{
3-
"tag": "wiredupdev/php-cli-8.3-alpine",
3+
"namespace": "wiredupdev",
4+
"name": "php-cli-8.3-alpine",
45
"path": "8.3-alpine/cli",
5-
"version": "2026.1.1",
6+
"tag": "2026.1.1",
67
"stages": ["dev"],
78
"build": true,
89
"push": true
910
},
1011
{
11-
"tag": "wiredupdev/php-fpm-8.3-alpine",
12+
"namespace": "wiredupdev",
13+
"name": "php-fpm-8.3-alpine",
1214
"path": "8.3-alpine/fpm",
13-
"version": "2026.1.1",
15+
"tag": "2026.1.1",
1416
"stages": ["dev", "prod"],
1517
"build": true,
1618
"push": true
1719
},
1820
{
19-
"tag": "wiredupdev/php-cli-8.4-alpine",
21+
"namespace": "wiredupdev",
22+
"name": "php-cli-8.4-alpine",
2023
"path": "8.4-alpine/cli",
21-
"version": "2026.1.1",
24+
"tag": "2026.1.1",
2225
"stages": ["dev", "prod"],
2326
"build": true,
2427
"push": true
2528
},
2629
{
27-
"tag": "wiredupdev/php-fpm-8.4-alpine",
30+
"namespace": "wiredupdev",
31+
"name": "php-fpm-8.4-alpine",
2832
"path": "8.4-alpine/fpm",
29-
"version": "2026.1.1",
33+
"tag": "2026.1.1",
3034
"stages": ["dev", "prod"],
3135
"build": true,
3236
"push": true

0 commit comments

Comments
 (0)