From 64494fe5b21f4a3110420464cf4b02ceb89af7ab Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 15 Mar 2024 13:29:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0gitea=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81CI=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CI.yaml | 52 ++++++++++++++++++++++++++++++++++++++++ Dockerfile_Gitea | 5 ++++ 2 files changed, 57 insertions(+) create mode 100644 .gitea/workflows/CI.yaml create mode 100644 Dockerfile_Gitea diff --git a/.gitea/workflows/CI.yaml b/.gitea/workflows/CI.yaml new file mode 100644 index 0000000..09afdb4 --- /dev/null +++ b/.gitea/workflows/CI.yaml @@ -0,0 +1,52 @@ +name: CI +run-name: ${{ gitea.actor }} is testing out Gitea Actions +on: + push: + branches: + - develop + +jobs: + Docker-Build: + runs-on: joylink-local233 + steps: + - name: 检出代码 + uses: https://gitea.joylink.club/actions/checkout@v4 + with: + submodules: recursive + - name: 设置go环境 + uses: https://gitea.joylink.club/actions/local-setup-go@v0.1.1 + with: + go-version: '1.22.1' + - name: 构建go build + run: | + go env -w GO111MODULE=on + go env -w GOPROXY=https://goproxy.cn,direct + go build -o rts-sim-testing-service + - name: 设置 Docker Buildx + uses: https://gitea.joylink.club/docker/setup-buildx-action@v3 + - 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: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile_Gitea + push: true + tags: | + gitea.joylink.club/joylink/rts-sim-testing-service:0.1.1 + gitea.joylink.club/joylink/rts-sim-testing-service:latest + # - name: SSH Connect and Publish + # uses: http://120.46.212.6:3000/appleboy/ssh-action@v1.0.3 + # with: + # host: ${{ secrets.LOCAL_SSH_HOST }} + # port: ${{ secrets.LOCAL_SSH_PORT }} + # username: ${{ secrets.LOCAL_SSH_USER }} + # password: ${{ secrets.LOCAL_SSH_PASSWORD }} + # script: | + # whoami + # sudo docker images + - run: echo "This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/Dockerfile_Gitea b/Dockerfile_Gitea new file mode 100644 index 0000000..978eb87 --- /dev/null +++ b/Dockerfile_Gitea @@ -0,0 +1,5 @@ +FROM alpine +COPY ./rts-sim-testing-service /usr/local/bin/rts-sim-testing-service +WORKDIR /bj-rtsts +COPY ./config/*.yml ./ +CMD [ "rts-sim-testing-service" ] \ No newline at end of file From fbb284909a79ebb75a8f0202b8dc0bb0ccbfe452 Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 15 Mar 2024 13:53:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9action=E6=A3=80=E5=87=BA?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CI.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/CI.yaml b/.gitea/workflows/CI.yaml index 09afdb4..2f29b5a 100644 --- a/.gitea/workflows/CI.yaml +++ b/.gitea/workflows/CI.yaml @@ -24,6 +24,8 @@ jobs: go build -o rts-sim-testing-service - name: 设置 Docker Buildx uses: https://gitea.joylink.club/docker/setup-buildx-action@v3 + with: + version: https://gitea.joylink.club/docker/buildx.git#master - name: docker登录gitea.joylink.club uses: https://gitea.joylink.club/docker/login-action@v3 with: @@ -31,7 +33,7 @@ jobs: username: shengxuqiang password: ${{ secrets.SHENGXUQIANG_PASSWORD }} - name: Build and push - uses: docker/build-push-action@v5 + uses: https://gitea.joylink.club/docker/build-push-action@v5 with: context: . file: ./Dockerfile_Gitea From 73ab803b7aaba2906535229fc4843b3275588df8 Mon Sep 17 00:00:00 2001 From: walker Date: Fri, 15 Mar 2024 16:02:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AE=BE=E7=BD=AEdocker=20buildx=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9E=E7=8E=B0action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/CI.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/CI.yaml b/.gitea/workflows/CI.yaml index 2f29b5a..a1d02e3 100644 --- a/.gitea/workflows/CI.yaml +++ b/.gitea/workflows/CI.yaml @@ -23,16 +23,16 @@ jobs: go env -w GOPROXY=https://goproxy.cn,direct go build -o rts-sim-testing-service - name: 设置 Docker Buildx - uses: https://gitea.joylink.club/docker/setup-buildx-action@v3 + uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.1 with: - version: https://gitea.joylink.club/docker/buildx.git#master + version: 'v0.13.1' - 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: Build and push + - name: Docker Build and push uses: https://gitea.joylink.club/docker/build-push-action@v5 with: context: .