Update frontend service to use port 3000 #18
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: Build and Push Images | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build-and-push: | |
| name: Build & Push All Images | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lowercase Image Prefix | |
| run: | | |
| echo "IMAGE_PREFIX=${GITHUB_REPOSITORY_OWNER,,}/constellation-hub" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=latest" >> $GITHUB_OUTPUT | |
| fi | |
| echo "sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | |
| # Build and push backend services | |
| - name: Build & Push core-orbits | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| file: ./backend/core-orbits/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/core-orbits:${{ steps.meta.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/core-orbits:${{ steps.meta.outputs.sha }} | |
| cache-from: type=gha,scope=core-orbits | |
| cache-to: type=gha,mode=max,scope=core-orbits | |
| - name: Build & Push routing | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| file: ./backend/routing/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/routing:${{ steps.meta.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/routing:${{ steps.meta.outputs.sha }} | |
| cache-from: type=gha,scope=routing | |
| cache-to: type=gha,mode=max,scope=routing | |
| - name: Build & Push ground-scheduler | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| file: ./backend/ground-scheduler/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ground-scheduler:${{ steps.meta.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ground-scheduler:${{ steps.meta.outputs.sha }} | |
| cache-from: type=gha,scope=ground-scheduler | |
| cache-to: type=gha,mode=max,scope=ground-scheduler | |
| - name: Build & Push ai-agents | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| file: ./backend/ai-agents/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ai-agents:${{ steps.meta.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ai-agents:${{ steps.meta.outputs.sha }} | |
| cache-from: type=gha,scope=ai-agents | |
| cache-to: type=gha,mode=max,scope=ai-agents | |
| # Build and push frontend | |
| - name: Build & Push frontend | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./frontend/web | |
| file: ./frontend/web/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/frontend:${{ steps.meta.outputs.tag }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/frontend:${{ steps.meta.outputs.sha }} | |
| build-args: | | |
| VITE_CORE_ORBITS_URL= | |
| VITE_ROUTING_URL= | |
| VITE_GROUND_SCHEDULER_URL= | |
| VITE_AI_AGENTS_URL= | |
| cache-from: type=gha,scope=frontend | |
| cache-to: type=gha,mode=max,scope=frontend | |
| - name: Summary | |
| run: | | |
| echo "### 🐳 Images Published" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Service | Image |" >> $GITHUB_STEP_SUMMARY | |
| echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| Core Orbits | \`${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/core-orbits:${{ steps.meta.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Routing | \`${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/routing:${{ steps.meta.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Ground Scheduler | \`${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ground-scheduler:${{ steps.meta.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY | |
| echo "| AI Agents | \`${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/ai-agents:${{ steps.meta.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY | |
| echo "| Frontend | \`${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/frontend:${{ steps.meta.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY |