Compare commits

...

8 Commits

Author SHA1 Message Date
bamanker
057cb5de38 本地build fix3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 22m31s
2025-12-30 10:40:41 +08:00
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
3 changed files with 22 additions and 20 deletions

View File

@@ -21,8 +21,13 @@ env:
# 构建 Job
jobs:
build:
runs-on: ubuntu-latest
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: echo "GRAALVM_HOME=/usr/lib/jvm/graalvm-jdk-25.0.1+8.1" >> $GITHUB_ENV && echo "PATH=$GRAALVM_HOME/bin:$PATH" >> $GITHUB_ENV
- run: env && java -version
# 下载仓库源码依赖node环境因此构建服务器本地需要下载安装node并设置环境变量
- name: Checkout repository code
#使用自定义仓库action
@@ -50,16 +55,16 @@ 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: 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: mvn clean native:compile -DskipTests -Pnative
run: /usr/local/maven/bin/mvn clean native:compile -DskipTests -Pnative
# 登录镜像仓库,方便后续上传镜像
- name: Login to Docker Registry
@@ -90,11 +95,8 @@ jobs:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
#发布到 k8s
- name: Generate kubeconfig
uses: http://localhost:3000/bamanker/kubectl-action@v1.4.0
with:
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
- name: Deploy k8s
#发布到 k8s
- name: Generate kubeconfig and deploy
run: kubectl apply -f ./deployment.yml
# command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment-temp.yml
- name: k8s Check Pods Health
@@ -103,4 +105,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/>