This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
name: lpt-ai Build & Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: 192.168.123.199:5000
|
||||||
|
APP: lpt-ai
|
||||||
|
DEPLOY_NS: lpt-dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set environment
|
||||||
|
id: env
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.ref_name }}" = "main" ]; then
|
||||||
|
echo "suffix=prod" >> $GITHUB_OUTPUT
|
||||||
|
echo "namespace=lpt-prod" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "suffix=dev" >> $GITHUB_OUTPUT
|
||||||
|
echo "namespace=lpt-dev" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t $REGISTRY/$APP:${{ steps.env.outputs.suffix }} .
|
||||||
|
docker push $REGISTRY/$APP:${{ steps.env.outputs.suffix }}
|
||||||
|
|
||||||
|
- name: Deploy to K8s
|
||||||
|
run: |
|
||||||
|
kubectl rollout restart deployment/$APP -n ${{ steps.env.outputs.namespace }}
|
||||||
Reference in New Issue
Block a user