name: Build and Push Docker Image on: push: branches: [ master, main ] workflow_dispatch: jobs: build-backend: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push backend uses: docker/build-push-action@v4 with: context: ./backend file: ./backend/Dockerfile push: true tags: 537yaha/ai-cs-backend:latest platforms: linux/amd64,linux/arm64 build-frontend: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push frontend uses: docker/build-push-action@v4 with: context: ./frontend file: ./frontend/Dockerfile push: true tags: 537yaha/ai-cs-frontend:latest platforms: linux/amd64,linux/arm64 build-args: | NEXT_PUBLIC_API_BASE_URL=http://localhost:18080 NEXT_PUBLIC_BACKEND_PORT=18080