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
This commit is contained in:
sirius0xdev 2026-05-02 22:29:06 +00:00
parent d94e62d77c
commit 6599249d65
2 changed files with 53 additions and 1 deletions

52
.github/workflows/trade-dashboard.yml vendored Normal file
View file

@ -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

View file

@ -22,7 +22,7 @@ spec:
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
containers: containers:
- name: dashboard - name: dashboard
image: us-central1-docker.pkg.dev/devops-lab-cluster/customer1/trade-dashboard:latest image: ghcr.io/sirius0xdev/trade-dashboard:latest
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 8000 - containerPort: 8000