Files
lpt-fe/.gitea/workflows/deploy.yml
T

33 lines
788 B
YAML

name: lpt-fe Build & Deploy
on:
workflow_dispatch:
inputs:
environment:
description: '部署环境'
required: true
type: choice
options:
- dev
- prod
env:
REGISTRY: 192.168.123.199:5000
APP: lpt-fe
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build & Push Docker image
run: |
docker build --build-arg BUILD_MODE=${{ inputs.environment == 'prod' && 'production' || 'development' }} \
-t $REGISTRY/$APP:${{ inputs.environment }} .
docker push $REGISTRY/$APP:${{ inputs.environment }}
- name: Deploy to K8s
run: |
kubectl rollout restart deployment/$APP -n lpt-${{ inputs.environment }}