Skip to content

Commit f1bb4f2

Browse files
committed
chore(stg): add staging workflows for php84, worker84, and worker85; update image names for node and php85 staging; fix Dockerfile USER_ID env order
1 parent 657a46c commit f1bb4f2

File tree

10 files changed

+294
-7
lines changed

10 files changed

+294
-7
lines changed

.github/workflows/node22-docker-stg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: write
1313

1414
env:
15-
IMAGE_NAME: dev-node22
15+
IMAGE_NAME: dev-node22-stg
1616
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1717
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
1818
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}

.github/workflows/node24-docker-stg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: write
1313

1414
env:
15-
IMAGE_NAME: dev-node24
15+
IMAGE_NAME: dev-node24-stg
1616
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1717
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
1818
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Publish PHP 8.4 STG image to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'php84/**'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
env:
15+
IMAGE_NAME: dev-php84-stg
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
18+
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}
19+
STG_USER_ID: ${{ secrets.STG_USER_ID }}
20+
STG_GROUP_ID: ${{ secrets.STG_GROUP_ID }}
21+
22+
jobs:
23+
build_and_push_stg:
24+
if: github.event_name != 'pull_request'
25+
name: Build and push PHP 8.4 STG image
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Log into Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
registry: https://index.docker.io/v1/
40+
username: ${{ env.DOCKERHUB_USERNAME }}
41+
password: ${{ env.DOCKERHUB_PASSWORD }}
42+
43+
- name: Get latest version tag
44+
id: get_version
45+
run: |
46+
git fetch --tags
47+
latest_tag=$(git tag -l | grep -E '^vphp84-stg' | sort -V | tail -n 1)
48+
echo "Latest tag: $latest_tag"
49+
echo "version=$latest_tag" >> $GITHUB_OUTPUT
50+
51+
- name: Increment version number
52+
id: inc_version
53+
run: |
54+
version=${{ steps.get_version.outputs.version }}
55+
version=${version#"vphp84-stg-"}
56+
if [ -z "$version" ]; then
57+
major=0
58+
minor=0
59+
patch=0
60+
else
61+
IFS='.' read -r -a parts <<< "$version"
62+
major=${parts[0]:-0}
63+
minor=${parts[1]:-0}
64+
patch=${parts[2]:-0}
65+
fi
66+
patch=$((patch+1))
67+
if [ "$patch" -ge 100 ]; then
68+
patch=0
69+
minor=$((minor+1))
70+
fi
71+
if [ "$minor" -ge 10 ]; then
72+
minor=0
73+
major=$((major+1))
74+
fi
75+
new_version="vphp84-stg-$major.$minor.$patch"
76+
echo "New version: $new_version"
77+
echo "new_version=$new_version" >> $GITHUB_OUTPUT
78+
79+
- name: Set new version tag
80+
run: |
81+
git tag ${{ steps.inc_version.outputs.new_version }}
82+
git push origin ${{ steps.inc_version.outputs.new_version }}
83+
84+
- name: Build and push PHP84 STG image
85+
uses: docker/build-push-action@v6
86+
with:
87+
context: php84
88+
push: true
89+
tags: |
90+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:stg
91+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:${{ steps.inc_version.outputs.new_version }}
92+
build-args: |
93+
PHP_VERSION=8.4
94+
USER_ID=${{ env.STG_USER_ID }}
95+
GROUP_ID=${{ env.STG_GROUP_ID }}
96+
PHP_VERSION_SHORT=84

.github/workflows/php85-docker-stg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: write
1313

1414
env:
15-
IMAGE_NAME: dev-php85
15+
IMAGE_NAME: dev-php85-stg
1616
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1717
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
1818
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Publish Worker 84 STG image to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'worker84/**'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
env:
15+
IMAGE_NAME: dev-worker84-stg
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
18+
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}
19+
STG_USER_ID: ${{ secrets.STG_USER_ID }}
20+
STG_GROUP_ID: ${{ secrets.STG_GROUP_ID }}
21+
22+
jobs:
23+
build_and_push_stg:
24+
if: github.event_name != 'pull_request'
25+
name: Build and push Worker 84 STG image
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Log into Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
registry: https://index.docker.io/v1/
40+
username: ${{ env.DOCKERHUB_USERNAME }}
41+
password: ${{ env.DOCKERHUB_PASSWORD }}
42+
43+
- name: Get latest version tag
44+
id: get_version
45+
run: |
46+
git fetch --tags
47+
latest_tag=$(git tag -l | grep -E '^vworker84-stg' | sort -V | tail -n 1)
48+
echo "Latest tag: $latest_tag"
49+
echo "version=$latest_tag" >> $GITHUB_OUTPUT
50+
51+
- name: Increment version number
52+
id: inc_version
53+
run: |
54+
version=${{ steps.get_version.outputs.version }}
55+
version=${version#"vworker84-stg-"}
56+
if [ -z "$version" ]; then
57+
major=0
58+
minor=0
59+
patch=0
60+
else
61+
IFS='.' read -r -a parts <<< "$version"
62+
major=${parts[0]:-0}
63+
minor=${parts[1]:-0}
64+
patch=${parts[2]:-0}
65+
fi
66+
patch=$((patch+1))
67+
if [ "$patch" -ge 100 ]; then
68+
patch=0
69+
minor=$((minor+1))
70+
fi
71+
if [ "$minor" -ge 10 ]; then
72+
minor=0
73+
major=$((major+1))
74+
fi
75+
new_version="vworker84-stg-$major.$minor.$patch"
76+
echo "New version: $new_version"
77+
echo "new_version=$new_version" >> $GITHUB_OUTPUT
78+
79+
- name: Set new version tag
80+
run: |
81+
git tag ${{ steps.inc_version.outputs.new_version }}
82+
git push origin ${{ steps.inc_version.outputs.new_version }}
83+
84+
- name: Build and push Worker 84 STG image
85+
uses: docker/build-push-action@v6
86+
with:
87+
context: worker84
88+
push: true
89+
tags: |
90+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:stg
91+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:${{ steps.inc_version.outputs.new_version }}
92+
build-args: |
93+
PHP_VERSION=8.4
94+
USER_ID=${{ env.STG_USER_ID }}
95+
GROUP_ID=${{ env.STG_GROUP_ID }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Publish Worker 85 STG image to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'worker85/**'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
env:
15+
IMAGE_NAME: dev-worker85-stg
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
18+
DOCKERHUB_ID: ${{ secrets.DOCKERHUB_ID }}
19+
STG_USER_ID: ${{ secrets.STG_USER_ID }}
20+
STG_GROUP_ID: ${{ secrets.STG_GROUP_ID }}
21+
22+
jobs:
23+
build_and_push_stg:
24+
if: github.event_name != 'pull_request'
25+
name: Build and push Worker 85 STG image
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Setup Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Log into Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
registry: https://index.docker.io/v1/
40+
username: ${{ env.DOCKERHUB_USERNAME }}
41+
password: ${{ env.DOCKERHUB_PASSWORD }}
42+
43+
- name: Get latest version tag
44+
id: get_version
45+
run: |
46+
git fetch --tags
47+
latest_tag=$(git tag -l | grep -E '^vworker85-stg' | sort -V | tail -n 1)
48+
echo "Latest tag: $latest_tag"
49+
echo "version=$latest_tag" >> $GITHUB_OUTPUT
50+
51+
- name: Increment version number
52+
id: inc_version
53+
run: |
54+
version=${{ steps.get_version.outputs.version }}
55+
version=${version#"vworker85-stg-"}
56+
if [ -z "$version" ]; then
57+
major=0
58+
minor=0
59+
patch=0
60+
else
61+
IFS='.' read -r -a parts <<< "$version"
62+
major=${parts[0]:-0}
63+
minor=${parts[1]:-0}
64+
patch=${parts[2]:-0}
65+
fi
66+
patch=$((patch+1))
67+
if [ "$patch" -ge 100 ]; then
68+
patch=0
69+
minor=$((minor+1))
70+
fi
71+
if [ "$minor" -ge 10 ]; then
72+
minor=0
73+
major=$((major+1))
74+
fi
75+
new_version="vworker85-stg-$major.$minor.$patch"
76+
echo "New version: $new_version"
77+
echo "new_version=$new_version" >> $GITHUB_OUTPUT
78+
79+
- name: Set new version tag
80+
run: |
81+
git tag ${{ steps.inc_version.outputs.new_version }}
82+
git push origin ${{ steps.inc_version.outputs.new_version }}
83+
84+
- name: Build and push Worker 85 STG image
85+
uses: docker/build-push-action@v6
86+
with:
87+
context: worker85
88+
push: true
89+
tags: |
90+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:stg
91+
${{ env.DOCKERHUB_ID }}/${{ env.IMAGE_NAME }}:${{ steps.inc_version.outputs.new_version }}
92+
build-args: |
93+
PHP_VERSION=8.5
94+
USER_ID=${{ env.STG_USER_ID }}
95+
GROUP_ID=${{ env.STG_GROUP_ID }}

php84/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
1515

1616
## Config user
1717
ARG USER_ID=1000
18-
ENV USER_ID=${USER_ID}
1918
ARG GROUP_ID=1000
19+
ENV USER_ID=${USER_ID}
2020
ENV GROUP_ID=${GROUP_ID}
2121

2222
# ensure www-data user exists

php85/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
1515

1616
## Config user
1717
ARG USER_ID=1000
18-
ENV USER_ID=${USER_ID}
1918
ARG GROUP_ID=1000
19+
ENV USER_ID=${USER_ID}
2020
ENV GROUP_ID=${GROUP_ID}
2121

2222
# ensure www-data user exists

worker84/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ LABEL description="PHP Worker image for CSlant development"
88
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
99

1010
ARG USER_ID=1000
11-
ENV USER_ID ${USER_ID}
1211
ARG GROUP_ID=1000
12+
ENV USER_ID ${USER_ID}
1313
ENV GROUP_ID ${GROUP_ID}
1414

1515
RUN set -eu; \

worker85/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ LABEL description="PHP Worker image for CSlant development"
88
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
99

1010
ARG USER_ID=1000
11-
ENV USER_ID ${USER_ID}
1211
ARG GROUP_ID=1000
12+
13+
ENV USER_ID ${USER_ID}
1314
ENV GROUP_ID ${GROUP_ID}
1415

1516
RUN set -eu; \

0 commit comments

Comments
 (0)