mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 13:53:36 +08:00
chore: 更新 Web 项目发布构建的 GitHub Action,简化 Docker 相关配置,移除不必要的输入参数和步骤,优化描述信息以提高可读性。
This commit is contained in:
@@ -75,37 +75,9 @@ jobs:
|
||||
with:
|
||||
gitea-token: ${{ secrets.GITEA_TOKEN }}
|
||||
app-env: ${{ github.ref == 'refs/heads/main' && 'production' || 'develop' }}
|
||||
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
sentry-dsn: ${{ vars.SENTRY_DSN }}
|
||||
enable-sentry: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}
|
||||
docker-registry: ${{ env.REGISTRY }}
|
||||
dockerfile-path: "./Dockerfile"
|
||||
docker-tags: |
|
||||
${{ github.sha }}
|
||||
${{ github.ref_name }}
|
||||
${{ github.ref == 'refs/heads/main' && 'stable' || 'unstable' }}
|
||||
|
||||
- name: 部署到Kubernetes (生产环境)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
echo "🚀 部署到生产环境..."
|
||||
kubectl set image deployment/web-app \
|
||||
web-app=${{ env.REGISTRY }}/${{ github.event.repository.name }}:${{ steps.release.outputs.version }} \
|
||||
-n production
|
||||
kubectl rollout status deployment/web-app -n production
|
||||
|
||||
- name: 部署到Kubernetes (开发环境)
|
||||
if: github.ref == 'refs/heads/develop'
|
||||
run: |
|
||||
echo "🧪 部署到开发环境..."
|
||||
kubectl set image deployment/web-app-dev \
|
||||
web-app=${{ env.REGISTRY }}/${{ github.event.repository.name }}:${{ steps.release.outputs.version }} \
|
||||
-n development
|
||||
kubectl rollout status deployment/web-app-dev -n development
|
||||
|
||||
- name: 通知发布结果
|
||||
run: |
|
||||
echo "🎉 发布完成!"
|
||||
echo "📦 版本: ${{ steps.release.outputs.version }}"
|
||||
echo "🌍 环境: ${{ github.ref == 'refs/heads/main' && '生产环境' || '开发环境' }}"
|
||||
echo "🐳 Docker镜像: ${{ env.REGISTRY }}/${{ github.event.repository.name }}:${{ steps.release.outputs.version }}"
|
||||
|
Reference in New Issue
Block a user