Compare commits

..

7 Commits

Author SHA1 Message Date
bamanker
afa97145c1 更改kubectl的action
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m57s
2026-01-04 16:13:16 +08:00
bamanker
2f39836963 修复mount source: "overlay" 错误的问题 5
Some checks failed
Build Push and Deploy Image / build (push) Failing after 21m14s
2026-01-04 15:19:05 +08:00
bamanker
d9807291ad 修复mount source: "overlay" 错误的问题 4
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m19s
2026-01-04 14:59:41 +08:00
bamanker
27c3ab7b82 修复mount source: "overlay" 错误的问题 3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 24s
2026-01-04 14:58:27 +08:00
bamanker
67ce2b5c86 修复mount source: "overlay" 错误的问题 2
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-04 14:03:19 +08:00
bamanker
be67a8fef0 修复mount source: "overlay" 错误的问题 1
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2026-01-04 13:09:17 +08:00
bamanker
6b47cfd5f8 修复mount source: "overlay" 错误的问题 1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 2m11s
2026-01-04 12:55:38 +08:00

View File

@@ -21,18 +21,23 @@ env:
# 构建 Job
jobs:
build:
runs-on: ubuntu-node22 # 如果host构建 linux_amd64
runs-on: ubuntu-node22 # 如果host构建:linux_amd64
# container:
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Print system info 1
run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- name: Print system info 2
run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- name: Print system info 3
run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Print env
run: env
run: env && blkid
- name: Install dependencies
run: |
apt-get update &&
@@ -40,12 +45,13 @@ jobs:
apt-get install -y maven &&
apt-get install -y sudo &&
apt-get install -y iptables
- name: Set up Docker
uses: http://139.9.216.111:3000/bamanker/setup-docker-action@v4
with:
version: type=archive,channel=stable,version=v27.4.0
daemon-config: |
{
"storage-driver":"devicemapper",
"registry-mirrors":["https://docker.1ms.run"],
"dns": ["8.8.8.8", "114.114.114.114"]
}
@@ -80,9 +86,7 @@ jobs:
id: set_envar
run: |
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
echo "now workspace: ${{ github.workspace }}" &&
docker version &&
docker --help
echo "now workspace: ${{ github.workspace }}"
# 为其他配置文件注入环境变量
- name: Inject envVar
@@ -127,6 +131,7 @@ jobs:
ls &&
docker build --file Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} . &&
docker image ls
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} --push.
# uses: http://139.9.216.111:3000/bamanker/docker-build-push@v5
# with:
@@ -138,16 +143,24 @@ jobs:
#发布到 k8s
- name: Generate kubeconfig
uses: http://139.9.216.111:3000/bamanker/kubectl-action@v1.4.0
uses: http://139.9.216.111:3000/bamanker/kubectl@v1.35.0
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
- name: Deploy k8s
run: kubectl apply -f ./deployment.yml
# command: apply -f http://139.9.216.111:3000/bamanker/myk3sTest/raw/branch/master/.deploy/deployment-temp.yml
args: apply -f ./deployment.yml
- name: k8s Check Pods Health
run: kubectl get pod -n default -l app=${{ env.APP_NAME }}
uses: http://139.9.216.111:3000/bamanker/kubectl@v1.35.0
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: get pod -n default -l app=${{ env.APP_NAME }}
- name: k8s Update Deployment
run: kubectl rollout restart deployment ${{ env.APP_NAME }}
uses: http://139.9.216.111:3000/bamanker/kubectl@v1.35.0
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment ${{ env.APP_NAME }}