diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..a16052338 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,36 @@ +name: Rust + +on: + push: + branches: [ "main", "release", "debug" ] + pull_request: + branches: [ "refactoring" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: self-hosted + + container: + image: rust:latest + steps: + - name: Install build env + run: | + apt-get update && apt-get install -y libdbus-1-dev git-all make gcc docker.io protobuf-compiler build-essential pkg-config curl libssl-dev + - uses: actions/checkout@v4 + - run: cargo build --manifest-path=src/Cargo.toml + - uses: docker/login-action@v1 + with: + registry: sdv.lge.com + username: admin + password: ${{ secrets.HARBOR_PASSWORD }} + - run: | + git config --global --add safe.directory /__w/PICCOLO/PICCOLO + git_hash=$(git rev-parse --short "$GITHUB_SHA") + git_branch=${GITHUB_REF#refs/heads/} + docker build -t sdv.lge.com/demo/${git_branch}/piccolo:${git_hash} -f containers/Dockerfile . + docker push sdv.lge.com/demo/${git_branch}/piccolo:${git_hash} +