Skip to content

Commit

Permalink
ad github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daalvand committed Jul 27, 2023
1 parent 25d1059 commit ba31620
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Push Docker Images

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- 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
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
docker push daalvand/speed-test-nodejs:latest

0 comments on commit ba31620

Please sign in to comment.