cicd
Some checks failed
自动部署 / 部署应用 (push) Failing after 1m31s

This commit is contained in:
2026-06-02 22:49:41 +08:00
parent 1bcc63d5de
commit 2c3700f4f8

View File

@@ -1,18 +1,14 @@
name: 自动部署 name: 自动部署
on: on:
push: push:
branches: [ master ] branches: [ master]
jobs: jobs:
部署应用: 部署应用:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# 1.先把当前流水线拉取代码打包拷贝进gitea-runner容器/tmp - name: 拉取代码
- name: 拷贝代码到runner容器 uses: actions/checkout@v4
run: |
tar -cf code.tar .
docker cp code.tar gitea-runner:/tmp/
# 2.进入容器解压 + 执行kubectl apply
- name: k8s部署 - name: k8s部署
run: | run: |
docker exec gitea-runner sh -c "cd /tmp && rm -rf proj && mkdir proj && cd proj && tar -xf ../code.tar && /usr/local/bin/kubectl apply -f k8s/" /usr/local/bin/kubectl apply -f k8s/
docker exec gitea-runner /usr/local/bin/kubectl rollout restart deployment admin-ui -n kubernetes-dashboard /usr/local/bin/kubectl rollout restart deployment admin-ui -n kubernetes-dashboard