Skip to content

Commit a3fee09

Browse files
committed
wip;
1 parent 74e0d81 commit a3fee09

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,5 @@ jobs:
1111
build-and-push:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: docker login
16-
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
17-
1814
- name: Run build script
1915
run: chmod +x ./build.sh && ./build.sh

build.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/bin/bash
22

3-
# Exit if Docker credentials are not set
4-
if [ -z "$DOCKER_USER" ] || [ -z "$DOCKER_PASSWORD" ]; then
5-
echo "Docker username or password not set."
6-
exit 1
7-
fi
8-
93
# Login to Docker registry
104
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
115

@@ -15,26 +9,26 @@ versions=(8.0.30 8.1.29 8.2.20 8.3.8)
159
# Iterate through each version
1610
for version in "${versions[@]}"; do
1711
# Extract major and minor version for image tag
18-
major_minor=$(echo $version | cut -d '.' -f1,2 | tr -d '.')
12+
major_minor=$(echo "$version" | cut -d '.' -f1,2 | tr -d '.')
1913

2014
# Define repository name
2115
REPOSITORY="${REPO}:php$major_minor"
2216

2317
# Build and push image without xdebug
2418
docker build . --file php.Dockerfile \
25-
--build-arg PHP_VERSION=$version \
19+
--build-arg PHP_VERSION="$version" \
2620
--build-arg NODE_VERSION=20 \
2721
--build-arg WITH_XDEBUG=false \
2822
--no-cache \
29-
--tag $REPOSITORY
30-
docker push $REPOSITORY
23+
--tag "$REPOSITORY" \
24+
--push
3125

3226
# Build and push image with xdebug
3327
docker build . --file php.Dockerfile \
34-
--build-arg PHP_VERSION=$version \
28+
--build-arg PHP_VERSION="$version" \
3529
--build-arg NODE_VERSION=20 \
3630
--build-arg WITH_XDEBUG=true \
3731
--no-cache \
38-
--tag $REPOSITORY-xdebug
39-
docker push $REPOSITORY-xdebug
32+
--tag "$REPOSITORY"-xdebug \
33+
--push
4034
done

0 commit comments

Comments
 (0)