Compare commits

..

6 Commits

Author SHA1 Message Date
bamanker
e381ac36e1 修改了runs on 镜像为ubuntu 4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 5m24s
2025-12-30 12:49:13 +08:00
bamanker
009f6ae5b7 修改了runs on 镜像为ubuntu 2
Some checks failed
Build Push and Deploy Image / build (push) Failing after 3s
2025-12-30 12:32:40 +08:00
bamanker
ea2d7d76af 修改了runs on 镜像为ubuntu 1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 5s
2025-12-30 12:27:47 +08:00
bamanker
5dbb383d07 修改了runs on 镜像为ubuntu
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-30 12:25:06 +08:00
bamanker
699d6cc5c3 修改了runs on 镜像为ubuntu:jammy
Some checks failed
Build Push and Deploy Image / build (push) Failing after 36s
2025-12-30 12:04:00 +08:00
bamanker
499c3058fe 修改了runs on 镜像为node:22-alpine
Some checks failed
Build Push and Deploy Image / build (push) Failing after 55s
2025-12-30 11:32:54 +08:00
2 changed files with 26 additions and 16 deletions

View File

@@ -21,12 +21,19 @@ env:
# 构建 Job # 构建 Job
jobs: jobs:
build: build:
runs-on: linux_amd64 # 如果host构建 linux_amd64 runs-on: ubuntu-node # 如果host构建 linux_amd64
steps: steps:
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event." - 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 " 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 " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- run: env - run: env
- run: sudo apt-get update && sudo apt-get install -y envsubst
# - uses: http://localhost:3000/bamanker/setup-node@v6
# with:
# node-version: 24
# cache: 'npm'
# - run: node -v
# 下载仓库源码依赖node环境因此构建服务器本地需要下载安装node并设置环境变量 # 下载仓库源码依赖node环境因此构建服务器本地需要下载安装node并设置环境变量
- name: Checkout repository code - name: Checkout repository code
#使用自定义仓库action #使用自定义仓库action
@@ -54,16 +61,16 @@ jobs:
cat ./deployment.yml cat ./deployment.yml
# 构建java项目 # 构建java项目
# - name: Set up Java - name: Set up Java
# uses: http://localhost:3000/bamanker/setup-java@v5 uses: http://localhost:3000/bamanker/setup-java@v5
# with: with:
# distribution: 'graalvm' distribution: 'graalvm'
# java-version: '25.0.1' java-version: '25.0.1'
# cache: 'maven' cache: 'maven'
- name: Build with Maven - name: Build with Maven
#使用maven绝对路径执行打包命令 #使用maven绝对路径执行打包命令
run: /usr/local/maven/bin/mvn clean native:compile -DskipTests -Pnative run: mvn clean native:compile -DskipTests -Pnative
# 登录镜像仓库,方便后续上传镜像 # 登录镜像仓库,方便后续上传镜像
- name: Login to Docker Registry - name: Login to Docker Registry
@@ -94,8 +101,11 @@ jobs:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
#发布到 k8s #发布到 k8s
#发布到 k8s - name: Generate kubeconfig
- name: Generate kubeconfig and deploy uses: http://localhost:3000/bamanker/kubectl-action@v1.4.0
with:
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
- name: Deploy k8s
run: kubectl apply -f ./deployment.yml run: kubectl apply -f ./deployment.yml
# command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment-temp.yml # command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment-temp.yml
- name: k8s Check Pods Health - name: k8s Check Pods Health
@@ -104,3 +114,4 @@ jobs:
- name: k8s Update Deployment - name: k8s Update Deployment
run: kubectl rollout restart deployment ${{ env.APP_NAME }} run: kubectl rollout restart deployment ${{ env.APP_NAME }}

View File

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