Merge pull request #16 from GACWR/dev/eda-etl-3 #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Build & Push | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: docker-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # ── Rust API Image ────────────────────────────────────────── | |
| api: | |
| name: API | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push openmodelstudio/api | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: deploy/Dockerfile.api | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| gacwr/openmodelstudio-api:latest | |
| gacwr/openmodelstudio-api:${{ github.sha }} | |
| cache-from: type=gha,scope=api | |
| cache-to: type=gha,mode=max,scope=api | |
| # ── Frontend Image ───────────────────────────────────────── | |
| frontend: | |
| name: Frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push openmodelstudio/frontend | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: web | |
| file: deploy/Dockerfile.frontend | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| gacwr/openmodelstudio-frontend:latest | |
| gacwr/openmodelstudio-frontend:${{ github.sha }} | |
| build-args: | | |
| NEXT_PUBLIC_API_URL=http://localhost:31001 | |
| NEXT_PUBLIC_GRAPHQL_URL=http://localhost:31002/graphql | |
| cache-from: type=gha,scope=frontend | |
| cache-to: type=gha,mode=max,scope=frontend | |
| # ── PostGraphile Image ───────────────────────────────────── | |
| postgraphile: | |
| name: PostGraphile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push openmodelstudio/postgraphile | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: postgraphile | |
| file: deploy/Dockerfile.postgraphile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| gacwr/openmodelstudio-postgraphile:latest | |
| gacwr/openmodelstudio-postgraphile:${{ github.sha }} | |
| cache-from: type=gha,scope=postgraphile | |
| cache-to: type=gha,mode=max,scope=postgraphile | |
| # ── Python Model Runner Image ────────────────────────────── | |
| # Uses docker build + docker push (not Buildx push) to handle large PyTorch layers | |
| model-runner-python: | |
| name: Model Runner (Python) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Build image | |
| run: | | |
| docker build \ | |
| -f deploy/Dockerfile.model-runner-python \ | |
| -t gacwr/openmodelstudio-model-runner-python:latest \ | |
| -t gacwr/openmodelstudio-model-runner-python:${{ github.sha }} \ | |
| model-runner/python | |
| - name: Push image | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| docker push gacwr/openmodelstudio-model-runner-python:latest | |
| docker push gacwr/openmodelstudio-model-runner-python:${{ github.sha }} | |
| # ── Rust Model Runner Image ──────────────────────────────── | |
| model-runner-rust: | |
| name: Model Runner (Rust) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push openmodelstudio/model-runner-rust | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: model-runner/rust | |
| file: deploy/Dockerfile.model-runner-rust | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| gacwr/openmodelstudio-model-runner-rust:latest | |
| gacwr/openmodelstudio-model-runner-rust:${{ github.sha }} | |
| cache-from: type=gha,scope=model-runner-rust | |
| cache-to: type=gha,mode=max,scope=model-runner-rust | |
| # ── Workspace Image ──────────────────────────────────────── | |
| # Uses docker build + docker push (not Buildx push) to handle large jupyter layers | |
| workspace: | |
| name: Workspace | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| if: github.event_name != 'pull_request' | |
| run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin | |
| - name: Build image | |
| run: | | |
| docker build \ | |
| -f deploy/Dockerfile.workspace \ | |
| -t gacwr/openmodelstudio-workspace:latest \ | |
| -t gacwr/openmodelstudio-workspace:${{ github.sha }} \ | |
| . | |
| - name: Push image | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| docker push gacwr/openmodelstudio-workspace:latest | |
| docker push gacwr/openmodelstudio-workspace:${{ github.sha }} |