Skip to content

Commit

Permalink
wip;
Browse files Browse the repository at this point in the history
  • Loading branch information
lazerg committed Jun 25, 2024
1 parent 74e0d81 commit a3fee09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: docker login
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

- name: Run build script
run: chmod +x ./build.sh && ./build.sh
20 changes: 7 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

# Exit if Docker credentials are not set
if [ -z "$DOCKER_USER" ] || [ -z "$DOCKER_PASSWORD" ]; then
echo "Docker username or password not set."
exit 1
fi

# Login to Docker registry
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"

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

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

# Build and push image without xdebug
docker build . --file php.Dockerfile \
--build-arg PHP_VERSION=$version \
--build-arg PHP_VERSION="$version" \
--build-arg NODE_VERSION=20 \
--build-arg WITH_XDEBUG=false \
--no-cache \
--tag $REPOSITORY
docker push $REPOSITORY
--tag "$REPOSITORY" \
--push

# Build and push image with xdebug
docker build . --file php.Dockerfile \
--build-arg PHP_VERSION=$version \
--build-arg PHP_VERSION="$version" \
--build-arg NODE_VERSION=20 \
--build-arg WITH_XDEBUG=true \
--no-cache \
--tag $REPOSITORY-xdebug
docker push $REPOSITORY-xdebug
--tag "$REPOSITORY"-xdebug \
--push
done

0 comments on commit a3fee09

Please sign in to comment.