rtsa-services/.gitea/workflows/cicd_local_test.yml
soul-walker bf9b3f501c
Some checks failed
build / build-rust (push) Failing after 43s
修改cicd(使用自己构建的docker镜像打包,reqwest还原使用openssl)
2024-09-23 15:41:40 +08:00

52 lines
2.0 KiB
YAML

name: build
on:
push:
branches:
- local-test
jobs:
build-rust:
runs-on: joylink-local233-rust
steps:
- name: 检出代码
uses: https://gitea.joylink.club/actions/checkout@v4
with:
submodules: recursive
- uses: https://gitea.joylink.club/actions/rust-cache@v2
- name: build Release
run: |
. ~/.bashrc
echo $PATH
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
- 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/rtss-simulation: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 rtss-simulation || echo "rtss-simulation not exist"
docker pull gitea.joylink.club/joylink/rtss-simulation:local-test
docker run --name rtss-simulation --restart=always -e RUN_MODE=local_test --network jlnet --ip 10.11.11.11 -d -p 8765:8765 -v /usr/local/joylink/logs/simulation:/logs/simulation gitea.joylink.club/joylink/rtss-simulation:local-test