cicd
This commit is contained in:
@@ -1,14 +1,13 @@
|
|||||||
name: 自动部署
|
name: 自动部署
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
jobs:
|
jobs:
|
||||||
部署应用:
|
部署应用:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: k8s部署
|
- name: k8s部署
|
||||||
run: |
|
run: |
|
||||||
# 把当前项目目录挂载进runner容器,在容器内部执行kubectl
|
docker cp ./ gitea-runner:/tmp/work/
|
||||||
docker cp . gitea-runner:/tmp/work
|
docker exec -w /tmp/work gitea-runner sh -c "/usr/local/bin/kubectl apply -f k8s/"
|
||||||
docker exec -w /tmp/work gitea-runner /usr/local/bin/kubectl apply -f k8s/
|
|
||||||
docker exec gitea-runner /usr/local/bin/kubectl rollout restart deployment admin-ui -n kubernetes-dashboard
|
docker exec gitea-runner /usr/local/bin/kubectl rollout restart deployment admin-ui -n kubernetes-dashboard
|
||||||
Reference in New Issue
Block a user