Compare commits

..

3 Commits

Author SHA1 Message Date
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
2 changed files with 16 additions and 19 deletions

View File

@@ -21,7 +21,7 @@ env:
# 构建 Job
jobs:
build:
runs-on: ubuntu-latest #如果host构建 linux_amd64
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!"
@@ -54,16 +54,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
@@ -94,11 +94,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
@@ -107,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: