Merge pull request #79 from sirius0xdev/feat/trade-dashboard-github-actions
feat(trade-dashboard): add GitHub Actions CI/CD + switch to ghcr.io
This commit is contained in:
commit
6afe8f41b7
2 changed files with 53 additions and 1 deletions
52
.github/workflows/trade-dashboard.yml
vendored
Normal file
52
.github/workflows/trade-dashboard.yml
vendored
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue