2024-03-15 13:29:28 +08:00
|
|
|
name: CI
|
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-03-18 17:20:34 +08:00
|
|
|
- local-test
|
2024-03-15 13:29:28 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
Docker-Build:
|
|
|
|
runs-on: joylink-local233
|
|
|
|
steps:
|
|
|
|
- name: 检出代码
|
|
|
|
uses: https://gitea.joylink.club/actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: 设置go环境
|
2024-03-19 16:27:57 +08:00
|
|
|
uses: https://gitea.joylink.club/actions/local-setup-go@v0.1.2
|
2024-03-15 13:29:28 +08:00
|
|
|
with:
|
|
|
|
go-version: '1.22.1'
|
|
|
|
- name: 构建go build
|
|
|
|
run: |
|
|
|
|
go env -w GO111MODULE=on
|
|
|
|
go env -w GOPROXY=https://goproxy.cn,direct
|
2024-03-19 16:27:57 +08:00
|
|
|
go env -w CGO_ENABLED=0
|
2024-03-15 13:29:28 +08:00
|
|
|
go build -o rts-sim-testing-service
|
2024-03-18 10:50:40 +08:00
|
|
|
- name: 设置 Docker
|
|
|
|
uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1
|
2024-03-18 13:57:08 +08:00
|
|
|
- name: 设置 Docker Buildx
|
2024-03-18 14:31:47 +08:00
|
|
|
uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3
|
2024-03-15 13:29:28 +08:00
|
|
|
- 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 }}
|
2024-03-15 16:02:50 +08:00
|
|
|
- name: Docker Build and push
|
2024-03-15 13:53:33 +08:00
|
|
|
uses: https://gitea.joylink.club/docker/build-push-action@v5
|
2024-03-15 13:29:28 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile_Gitea
|
|
|
|
push: true
|
|
|
|
tags: |
|
2024-03-18 17:20:34 +08:00
|
|
|
gitea.joylink.club/joylink/rts-sim-testing-service:local-test
|
|
|
|
- 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 rts-sim-testing-service || echo "rts-sim-testing-service not exist"
|
|
|
|
docker pull gitea.joylink.club/joylink/rts-sim-testing-service:local-test
|
|
|
|
docker run --name rts-sim-testing-service --restart=always --network net --ip 192.168.53.191 -d -p 9091:9091 -v /usr/local/joylink/logs/bjrtsts:/logs/bjrtsts gitea.joylink.club/joylink/rts-sim-testing-service:local-test rts-sim-testing-service -config test_local
|
2024-03-15 13:29:28 +08:00
|
|
|
- run: echo "This job's status is ${{ job.status }}."
|