mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 08:33:37 +08:00
feat: 添加构建和部署环境配置的 GitHub Action,包括 Docker 和 kubectl 的安装与配置,支持阿里云镜像源,提供详细的日志输出和错误处理。
This commit is contained in:
30
setup-env/examples/basic-workflow.yml
Normal file
30
setup-env/examples/basic-workflow.yml
Normal 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 "镜像推送完成!"
|
Reference in New Issue
Block a user