From 6597194b9c5675348bacebf51d3dbb02c747bc7c Mon Sep 17 00:00:00 2001 From: soul-walker Date: Mon, 25 Mar 2024 16:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=9C=A8git=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=96=B0=E7=89=88=E6=97=B6=E7=9A=84=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CI_master.yaml | 76 +++++++++++++++------------------ 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/.gitea/workflows/CI_master.yaml b/.gitea/workflows/CI_master.yaml index c704d10c4..662d8a8c7 100644 --- a/.gitea/workflows/CI_master.yaml +++ b/.gitea/workflows/CI_master.yaml @@ -2,57 +2,49 @@ name: CI-master run-name: ${{ gitea.actor }} is testing out Gitea Actions on: release: - types: [published, edited] + types: [published] jobs: - Docker-Build: + Docker-Build-Push: runs-on: joylink-local233 steps: - - name: 测试release触发及一些参数 - run: | - echo "event: author is ${{ github.event.release.author.name }}, isLatest is ${{ github.event.release.isLatest }}, isPrerelease is ${{ github.event.release.prerelease }}" - echo "event: name is ${{ github.event.release.name }}, tag is ${{ github.event.release.tag }}, tagName is ${{ github.event.release.tag_name }}" - echo "event_name: ${{ github.event_name }}" - echo "ref: ${{ github.ref }}" - name: 检出代码 uses: https://gitea.joylink.club/actions/checkout@v4 with: submodules: recursive - - name: 查看代码分支和版本 + - name: 设置java环境 + uses: https://gitea.joylink.club/actions/setup-java@v4 + with: + java-version: '11' + distribution: 'zulu' + cache: 'maven' + cache-dependency-path: './pom.xml' + - name: 设置Maven环境 + uses: https://gitea.joylink.club/actions/local-setup-maven@v0.1.1 + with: + maven-version: 3.8.8 + - name: 构建 run: | - git branch -vv - # - name: 设置java环境 - # uses: https://gitea.joylink.club/actions/setup-java@v4 - # with: - # java-version: '11' - # distribution: 'zulu' - # cache: 'maven' - # cache-dependency-path: './pom.xml' - # - name: 设置Maven环境 - # uses: https://gitea.joylink.club/actions/local-setup-maven@v0.1.1 - # with: - # maven-version: 3.8.8 - # - name: 构建 - # run: | - # mvn -Dmaven.test.skip=true clean package - # - name: 设置 Docker - # uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1 - # - name: 设置 Docker Buildx - # uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3 - # - name: docker登录gitea.joylink.club - # uses: https://gitea.joylink.club/docker/login-action@v3 - # with: - # registry: gitea.joylink.club - # username: shengxuqiang - # password: ${{ secrets.SHENGXUQIANG_PASSWORD }} - # - name: Docker Build and push - # uses: https://gitea.joylink.club/docker/build-push-action@v5 - # with: - # context: . - # file: ./Dockerfile - # push: true - # tags: | - # gitea.joylink.club/joylink/rt-sim-training-service:latest + mvn -Dmaven.test.skip=true clean package + - name: 设置 Docker + uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1 + - name: 设置 Docker Buildx + uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3 + - name: docker登录gitea.joylink.club + uses: https://gitea.joylink.club/docker/login-action@v3 + with: + registry: gitea.joylink.club + username: shengxuqiang + password: ${{ secrets.SHENGXUQIANG_PASSWORD }} + - name: Docker Build and push + uses: https://gitea.joylink.club/docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: | + gitea.joylink.club/joylink/rt-sim-training-service:${{ github.event.release.tag_name }} + gitea.joylink.club/joylink/rt-sim-training-service:latest # - name: 发布到本地测试环境 # uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 # with: