fix(builder): 修复团队信息获取时的用户 ID 错误- 将 UserID 字段的值从 middleware.GetUserID… #87
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build and Push | |
on: | |
push: | |
tags: | |
- 'v*' # 触发条件可以根据你的需求修改 | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
run: echo "${{ secrets.REPO_PASS }}" | docker login -u "${{ secrets.REPO }}" --password-stdin | |
- name: Get the latest tag | |
id: get_latest_tag | |
run: | | |
latest_tag=$(git describe --tags --always) | |
echo "Latest tag is $latest_tag" | |
echo "::set-output name=latest_tag::$latest_tag" | |
- name: Build and push Docker image | |
run: | | |
chmod +x build_images.sh | |
./build_images.sh "${{ secrets.REPO }}" | |
env: | |
REPO: ${{ secrets.REPO }} | |
REPO_PASS: ${{ secrets.REPO_PASS }} | |
- name: Send Release Notification | |
if: success() | |
run: | | |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"post","content":{"post":{"zh_cn":{"title":"moon项目更新通知","content":[[{"tag":"text","text":"palace项目有更新, 当前版本为: "},{"tag":"a","text":"${{ steps.get_latest_tag.outputs.latest_tag }}","href":"https://hub.docker.com/r/aidemoonio/palace/tags?name=${{ steps.get_latest_tag.outputs.latest_tag }}"}],[{"tag":"text","text":"houyi项目有更新, 当前版本为: "},{"tag":"a","text":"${{ steps.get_latest_tag.outputs.latest_tag }}","href":"https://hub.docker.com/r/aidemoonio/houyi/tags?name=${{ steps.get_latest_tag.outputs.latest_tag }}"}],[{"tag":"text","text":"rabbit项目有更新, 当前版本为: "},{"tag":"a","text":"${{ steps.get_latest_tag.outputs.latest_tag }}","href":"https://hub.docker.com/r/aidemoonio/rabbit/tags?name=${{ steps.get_latest_tag.outputs.latest_tag }}"}],[],[{"tag":"at","user_id":"all"}]]}}}}' ${{ secrets.HOOK }} | |
- name: Set up kubeconfig | |
run: | | |
mkdir -p $HOME/.kube | |
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config | |
env: | |
KUBECONFIG: $HOME/.kube/config | |
- name: Set up kubectl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: 'latest' | |
- name: Deploy to Kubernetes | |
run: | | |
kubectl --insecure-skip-tls-verify set image deployment/palace palace=docker.cloudimages.asia/${{ secrets.REPO }}/palace:${{ steps.get_latest_tag.outputs.latest_tag }} -n ${{ secrets.K8S_NAMESPACE }} | |
kubectl --insecure-skip-tls-verify set image deployment/rabbit rabbit=docker.cloudimages.asia/${{ secrets.REPO }}/rabbit:${{ steps.get_latest_tag.outputs.latest_tag }} -n ${{ secrets.K8S_NAMESPACE }} | |
kubectl --insecure-skip-tls-verify set image deployment/houyi houyi=docker.cloudimages.asia/${{ secrets.REPO }}/houyi:${{ steps.get_latest_tag.outputs.latest_tag }} -n ${{ secrets.K8S_NAMESPACE }} | |
- name: verify deployment | |
run: | | |
kubectl --insecure-skip-tls-verify rollout status deployment/palace -n ${{ secrets.K8S_NAMESPACE }} | |
kubectl --insecure-skip-tls-verify rollout status deployment/rabbit -n ${{ secrets.K8S_NAMESPACE }} | |
kubectl --insecure-skip-tls-verify rollout status deployment/houyi -n ${{ secrets.K8S_NAMESPACE }} | |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"post","content":{"post":{"zh_cn":{"title":"moon项目API部署通知","content":[[{"tag":"text","text":"moon项目API服务自动部署完成, 当前版本为: "},{"tag":"a","text":"${{ steps.get_latest_tag.outputs.latest_tag }}","href":"https://moon.aide-cloud.cn"}],[],[{"tag":"at","user_id":"all"}]]}}}}' ${{ secrets.HOOK }} |