feat: 添加构建和部署环境配置的 GitHub Action,包括 Docker 和 kubectl 的安装与配置,支持阿里云镜像源,提供详细的日志输出和错误处理。

This commit is contained in:
Lyda
2025-08-20 11:42:59 +08:00
parent 0c6afd9bcf
commit 8132353be7
11 changed files with 1622 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# 基本使用示例
name: Basic Build and Deploy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 配置构建环境
uses: xgj/actions/setup-env@v1
with:
docker-password: ${{ secrets.DOCKER_PASSWORD }}
- name: 构建应用
run: |
echo "开始构建应用..."
docker build -t my-app:${{ github.sha }} .
echo "构建完成!"
- name: 推送镜像
run: |
docker push my-app:${{ github.sha }}
echo "镜像推送完成!"