Compare commits

..

9 Commits

Author SHA1 Message Date
bamanker
bf1f52ad54 本地build fix2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 17s
2025-12-30 10:33:08 +08:00
bamanker
1696261450 本地build fix1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 19s
2025-12-30 10:28:31 +08:00
bamanker
5ca35df955 本地build
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21s
2025-12-30 10:06:49 +08:00
bamanker
21bc585376 修改了deploy参数 2025-12-29 22:58:14 +08:00
bamanker
00684cebf2 修改了runs-on镜像
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-29 21:45:52 +08:00
bamanker
a29c9c1085 修改了一些问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24m59s
2025-12-29 17:43:49 +08:00
bamanker
838e811619 修改了无法找到node的问题
Some checks failed
Build Push and Deploy Image / build (push) Failing after 4m48s
2025-12-29 17:23:04 +08:00
bamanker
e02119c1f3 action环境切换到ubuntu镜像
Some checks failed
Build Push and Deploy Image / build (push) Failing after 7m56s
2025-12-29 16:34:10 +08:00
bamanker
dfe90c96b2 fix build文件
Some checks failed
Build Push and Deploy Image / build (push) Failing after 14s
2025-12-28 22:47:18 +08:00
3 changed files with 24 additions and 12 deletions

View File

@@ -21,12 +21,16 @@ env:
# 构建 Job
jobs:
build:
runs-on: host
runs-on: linux_amd64 # 如果host构建 linux_amd64
steps:
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- run: env && java -version
# 下载仓库源码依赖node环境因此构建服务器本地需要下载安装node并设置环境变量
- name: Checkout repository code
#使用自定义仓库action
uses: http://139.9.216.111:3000/bamanker/checkout@v6
uses: http://localhost:3000/bamanker/checkout@v6
# 获取 TAG 并设置为环境变量
- name: Get version
@@ -50,13 +54,20 @@ jobs:
cat ./deployment.yml
# 构建java项目
# - name: Set up Java
# uses: http://localhost:3000/bamanker/setup-java@v5
# with:
# distribution: 'graalvm'
# java-version: '25.0.1'
# cache: 'maven'
- name: Build with Maven
#使用maven绝对路径执行打包命令
run: /usr/local/maven/bin/mvn clean package -DskipTests -Pprod
run: /usr/local/maven/bin/mvn clean native:compile -DskipTests -Pnative
# 登录镜像仓库,方便后续上传镜像
- name: Login to Docker Registry
uses: http://139.9.216.111:3000/bamanker/login-action@v3
uses: http://localhost:3000/bamanker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -71,7 +82,7 @@ jobs:
# 构建并上传镜像
- name: Build and push Docker image
uses: http://139.9.216.111:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 1.0.0
uses: http://localhost:3000/bamanker/build-push-action@v6 # 获取上一步截取到的版本号,既 1.0.0
#只能这样接收
env:
TAG: ${{ steps.set_envar.outputs.tag }}
@@ -82,6 +93,7 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
#发布到 k8s
#发布到 k8s
- name: Generate kubeconfig and deploy
run: kubectl apply -f ./deployment.yml
@@ -92,4 +104,3 @@ jobs:
- name: k8s Update Deployment
run: kubectl rollout restart deployment ${{ env.APP_NAME }}

View File

@@ -29,14 +29,15 @@ spec:
- image: $REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$APP_TAG
name: $APP_NAME
imagePullPolicy: Always
readinessProbe:
livenessProbe: # 存活探针:失败意味着应用彻底挂了,需要重启来恢复
httpGet:
path: /test
port: 9090
initialDelaySeconds: 1
timeoutSeconds: 10
failureThreshold: 30
successThreshold: 5
initialDelaySeconds: 10 # 延迟xx秒开始执行
periodSeconds: 15 # 每隔15秒执行一次
timeoutSeconds: 10 # 10秒未返回结果则超时
failureThreshold: 10 # 探测失败后的重试次数,当达到这个次数后就判定结果为失败
# successThreshold: 5
ports:
- containerPort: 9090
imagePullSecrets:

View File

@@ -11,7 +11,7 @@
<groupId>com.bamanker</groupId>
<artifactId>myk3sTest</artifactId>
<version>v3.1.0-native</version>
<version>v3.1-native</version>
<name>myk3sTest</name>
<description>myk3sTest</description>
<url/>