Compare commits

...

7 Commits

Author SHA1 Message Date
bamanker
44c6fab1f4 更换kubectl action,修复了bug3
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m17s
2025-12-26 16:37:45 +08:00
bamanker
cf924d1ee7 更换kubectl action,修复了bug1
Some checks failed
Build Push and Deploy Image / build (push) Failing after 47s
2025-12-26 16:04:13 +08:00
bamanker
d97d39e5c4 更换kubectl action,修复了bug
Some checks failed
Build Push and Deploy Image / build (push) Failing after 30s
2025-12-26 15:51:23 +08:00
bamanker
55f57f9085 更换kubectl action
All checks were successful
Build Push and Deploy Image / build (push) Successful in 2m7s
2025-12-26 15:42:05 +08:00
bamanker
0389942e4f debug22
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 15:00:39 +08:00
bamanker
bc853144b8 debug21
Some checks failed
Build Push and Deploy Image / build (push) Has been cancelled
2025-12-26 14:57:57 +08:00
bamanker
f5b1de075f add 显示注入后的deployment文件
Some checks failed
Build Push and Deploy Image / build (push) Failing after 1m14s
2025-12-26 12:50:09 +08:00

View File

@@ -39,12 +39,15 @@ jobs:
- name: Set envVar
id: set_envar
run: |
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT
echo "The app version is $APP_TAG" && echo "tag=$APP_TAG" >> $GITHUB_OUTPUT &&
echo "now workspace: ${{ github.workspace }}" &&
pwd
# 为其他配置文件注入环境变量
- name: Inject envVar
run: |
envsubst < ./deployment-temp.yml > ./deployment.yml
envsubst < ./deployment-temp.yml > ./deployment.yml &&
cat ./deployment.yml
# 构建java项目
- name: Build with Maven
@@ -80,22 +83,26 @@ jobs:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
#发布到 k8s
- name: k8s Check and Apply New Deployment
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
- name: Generate kubeconfig and deploy
uses: http://139.9.216.111:3000/bamanker/kubectl-helm-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
with:
config: ${{ secrets.KUBE_CONFIG }}
command: apply -f ./deployment.yml
args: 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
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
uses: http://139.9.216.111:3000/bamanker/kubectl-helm-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
with:
config: ${{ secrets.KUBE_CONFIG }}
command: get pod -n default -l app=${{ env.APP_NAME }}
args: kubectl get pod -n default -l app=${{ env.APP_NAME }}
- name: k8s Update Deployment
uses: http://139.9.216.111:3000/bamanker/steevchen-kubectl@master
uses: http://139.9.216.111:3000/bamanker/kubectl-helm-action@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
with:
command: rollout restart deployment ${{ env.APP_NAME }}-${{ gitea.ref_name }}
args: kubectl rollout restart deployment ${{ env.APP_NAME }}-${{ gitea.ref_name }}