Skip to content

Commit

Permalink
merge image push and build
Browse files Browse the repository at this point in the history
  • Loading branch information
daalvand committed Jul 27, 2023
1 parent ba31620 commit 8dbb02a
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,41 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and Push Docker images
run: |
DIR=$GITHUB_WORKSPACE
SERVICE_DIR="${DIR}/services"
DOCKER_BUILDKIT=1
docker buildx build -f "$DIR/Dockerfile" "$DIR" -t daalvand/speed-test-base:latest
docker buildx build -f "$SERVICE_DIR/pure-php/Dockerfile" "$SERVICE_DIR/pure-php" -t daalvand/speed-test-pure-php:latest
docker buildx build -f "$SERVICE_DIR/react-php/Dockerfile" "$SERVICE_DIR/react-php" -t daalvand/speed-test-react-php:latest
docker buildx build -f "$SERVICE_DIR/swoole-php/Dockerfile" "$SERVICE_DIR/swoole-php" -t daalvand/speed-test-swoole-php:latest
docker buildx build -f "$SERVICE_DIR/yii/Dockerfile" "$SERVICE_DIR/yii" -t daalvand/speed-test-yii:latest
docker buildx build -f "$SERVICE_DIR/codeigniter/Dockerfile" "$SERVICE_DIR/codeigniter" -t daalvand/speed-test-codeigniter:latest
docker buildx build -f "$SERVICE_DIR/laravel/FPMDockerfile" "$SERVICE_DIR/laravel" -t daalvand/speed-test-laravel:latest
docker buildx build -f "$SERVICE_DIR/laravel/SwooleDockerfile" "$SERVICE_DIR/laravel" -t daalvand/speed-test-laravel-octane:latest
docker buildx build -f "$SERVICE_DIR/go/Dockerfile" "$SERVICE_DIR/go" -t daalvand/speed-test-go:latest
docker buildx build -f "$SERVICE_DIR/fastapi/Dockerfile" "$SERVICE_DIR/fastapi" -t daalvand/speed-test-fastapi:latest
docker buildx build -f "$SERVICE_DIR/flask/Dockerfile" "$SERVICE_DIR/flask" -t daalvand/speed-test-flask:latest
docker buildx build -f "$SERVICE_DIR/nodejs/Dockerfile" "$SERVICE_DIR/nodejs" -t daalvand/speed-test-nodejs:latest
echo 'DONE!'
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker images
- name: Build and Push Docker images
run: |
docker push daalvand/speed-test-base:latest
docker push daalvand/speed-test-pure-php:latest
docker push daalvand/speed-test-react-php:latest
docker push daalvand/speed-test-swoole-php:latest
docker push daalvand/speed-test-yii:latest
docker push daalvand/speed-test-codeigniter:latest
docker push daalvand/speed-test-laravel:latest
docker push daalvand/speed-test-laravel-octane:latest
docker push daalvand/speed-test-go:latest
docker push daalvand/speed-test-fastapi:latest
docker push daalvand/speed-test-flask:latest
DIR=$GITHUB_WORKSPACE
SERVICE_DIR="${DIR}/services"
DOCKER_BUILDKIT=1
docker buildx build -f "$DIR/Dockerfile" "$DIR" -t daalvand/speed-test-base:latest &&
docker buildx build -f "$SERVICE_DIR/pure-php/Dockerfile" "$SERVICE_DIR/pure-php" -t daalvand/speed-test-pure-php:latest &&
docker buildx build -f "$SERVICE_DIR/react-php/Dockerfile" "$SERVICE_DIR/react-php" -t daalvand/speed-test-react-php:latest &&
docker buildx build -f "$SERVICE_DIR/swoole-php/Dockerfile" "$SERVICE_DIR/swoole-php" -t daalvand/speed-test-swoole-php:latest &&
docker buildx build -f "$SERVICE_DIR/yii/Dockerfile" "$SERVICE_DIR/yii" -t daalvand/speed-test-yii:latest &&
docker buildx build -f "$SERVICE_DIR/codeigniter/Dockerfile" "$SERVICE_DIR/codeigniter" -t daalvand/speed-test-codeigniter:latest &&
docker buildx build -f "$SERVICE_DIR/laravel/FPMDockerfile" "$SERVICE_DIR/laravel" -t daalvand/speed-test-laravel:latest &&
docker buildx build -f "$SERVICE_DIR/laravel/SwooleDockerfile" "$SERVICE_DIR/laravel" -t daalvand/speed-test-laravel-octane:latest &&
docker buildx build -f "$SERVICE_DIR/go/Dockerfile" "$SERVICE_DIR/go" -t daalvand/speed-test-go:latest &&
docker buildx build -f "$SERVICE_DIR/fastapi/Dockerfile" "$SERVICE_DIR/fastapi" -t daalvand/speed-test-fastapi:latest &&
docker buildx build -f "$SERVICE_DIR/flask/Dockerfile" "$SERVICE_DIR/flask" -t daalvand/speed-test-flask:latest &&
docker buildx build -f "$SERVICE_DIR/nodejs/Dockerfile" "$SERVICE_DIR/nodejs" -t daalvand/speed-test-nodejs:latest &&
docker push daalvand/speed-test-base:latest &&
docker push daalvand/speed-test-pure-php:latest &&
docker push daalvand/speed-test-react-php:latest &&
docker push daalvand/speed-test-swoole-php:latest &&
docker push daalvand/speed-test-yii:latest &&
docker push daalvand/speed-test-codeigniter:latest &&
docker push daalvand/speed-test-laravel:latest &&
docker push daalvand/speed-test-laravel-octane:latest &&
docker push daalvand/speed-test-go:latest &&
docker push daalvand/speed-test-fastapi:latest &&
docker push daalvand/speed-test-flask:latest &&
docker push daalvand/speed-test-nodejs:latest
echo 'DONE!'

0 comments on commit 8dbb02a

Please sign in to comment.