修改定时执行工作流
Some checks failed
CI / Docker-Build (push) Successful in 2m30s
公网服务发布 / Docker-Build-Push (push) Failing after 14s

添加清理docker tag为none镜像步骤
This commit is contained in:
soul-walker 2024-03-25 18:19:31 +08:00
parent 5045f6152a
commit 202037ec55
3 changed files with 30 additions and 13 deletions

View File

@ -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
- 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

View File

@ -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
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)

View File

@ -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: