From 6599249d653a8b2d0a8895390c5786cb129ca055 Mon Sep 17 00:00:00 2001 From: sirius0xdev Date: Sat, 2 May 2026 22:29:06 +0000 Subject: [PATCH] feat(trade-dashboard): add GitHub Actions CI/CD pipeline - Build and push Docker image to ghcr.io on push to master - Update deployment to pull from ghcr.io instead of GCR - Tags: commit SHA + latest on default branch --- .github/workflows/trade-dashboard.yml | 52 +++++++++++++++++++ .../customer1/trade-dashboard/deployment.yaml | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/trade-dashboard.yml diff --git a/.github/workflows/trade-dashboard.yml b/.github/workflows/trade-dashboard.yml new file mode 100644 index 0000000..c72b162 --- /dev/null +++ b/.github/workflows/trade-dashboard.yml @@ -0,0 +1,52 @@ +name: Build and Push Trade Dashboard + +on: + push: + branches: [master] + paths: + - 'apps/base/customer1/trade-dashboard/**' + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository_owner }}/trade-dashboard + +permissions: + contents: read + packages: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha,prefix= + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: apps/base/customer1/trade-dashboard + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/apps/base/customer1/trade-dashboard/deployment.yaml b/apps/base/customer1/trade-dashboard/deployment.yaml index ec5e0bb..ced595d 100644 --- a/apps/base/customer1/trade-dashboard/deployment.yaml +++ b/apps/base/customer1/trade-dashboard/deployment.yaml @@ -22,7 +22,7 @@ spec: terminationGracePeriodSeconds: 30 containers: - name: dashboard - image: us-central1-docker.pkg.dev/devops-lab-cluster/customer1/trade-dashboard:latest + image: ghcr.io/sirius0xdev/trade-dashboard:latest imagePullPolicy: Always ports: - containerPort: 8000