diff --git a/.gitea/workflows/CD_pub_deploy.yaml b/.gitea/workflows/CD_pub_deploy.yaml index def48d057..7e983328d 100644 --- a/.gitea/workflows/CD_pub_deploy.yaml +++ b/.gitea/workflows/CD_pub_deploy.yaml @@ -2,7 +2,7 @@ name: 公网服务发布 run-name: ${{ gitea.actor }} is testing out Gitea Actions on: schedule: - - cron: '*/5 * * * *' # 最多每5分钟执行一次 + - cron: '25 18 * * *' # 每天晚上19:15执行 jobs: Docker-Build-Push: @@ -10,14 +10,25 @@ jobs: steps: - name: 测试定时执行任务 run: echo "测试定时执行任务" - # - name: 发布到本地测试环境 - # uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 - # with: - # host: ${{ secrets.LOCAL_233_SSH_HOST }} - # port: ${{ secrets.LOCAL_233_SSH_PORT }} - # username: ${{ secrets.LOCAL_233_SSH_USER }} - # password: ${{ secrets.LOCAL_233_SSH_PASSWORD }} - # script: | - # docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist" - # docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest - # docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest \ No newline at end of file + - name: 发布到正式环境1 + uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PUB1_DOMAIN_SSH_HOST }} + port: ${{ secrets.PUB1_DOMAIN_SSH_PORT }} + username: ${{ secrets.PUB1_DOMAIN_SSH_USER }} + password: ${{ secrets.PUB1_DOMAIN_SSH_PASSWORD }} + script: | + docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist" + docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest + docker run --name rt-sim-training-service -it -u root --restart=always -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest + - name: 发布到正式环境2 + uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PUB2_DOMAIN_SSH_HOST }} + port: ${{ secrets.PUB2_DOMAIN_SSH_PORT }} + username: ${{ secrets.PUB2_DOMAIN_SSH_USER }} + password: ${{ secrets.PUB2_DOMAIN_SSH_PASSWORD }} + script: | + docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist" + docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest + docker run --name rt-sim-training-service -it -u root --restart=always -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest \ No newline at end of file diff --git a/.gitea/workflows/CICD_local_test.yaml b/.gitea/workflows/CICD_local_test.yaml index d4fd94950..07e24a602 100644 --- a/.gitea/workflows/CICD_local_test.yaml +++ b/.gitea/workflows/CICD_local_test.yaml @@ -55,4 +55,7 @@ jobs: script: | docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist" docker pull gitea.joylink.club/joylink/rt-sim-training-service:local-test - docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=local-test -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:local-test \ No newline at end of file + docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=local-test -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:local-test + - name: 清理tag为none的镜像 + run: | + docker rmi $(docker images --filter "dangling=true" -q) \ No newline at end of file diff --git a/.gitea/workflows/CI_release_build.yaml b/.gitea/workflows/CI_release_build.yaml index cc7b19321..e072c3371 100644 --- a/.gitea/workflows/CI_release_build.yaml +++ b/.gitea/workflows/CI_release_build.yaml @@ -45,6 +45,9 @@ jobs: tags: | gitea.joylink.club/joylink/rt-sim-training-service:${{ github.event.release.tag_name }} gitea.joylink.club/joylink/rt-sim-training-service:latest + - name: 清理tag为none的镜像 + run: | + docker rmi $(docker images --filter "dangling=true" -q) # - name: 发布到本地测试环境 # uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 # with: