name: ci
on:
  push:
    paths:
      - 'packages/libraries/router/**'
      - 'docker/router.dockerfile'
      - 'scripts/compress/**'
      - 'configs/cargo/Cargo.lock'
      - 'Cargo.lock'
      - 'Cargo.toml'
    branches:
      - main

jobs:
  # Builds Rust crates, and creates Docker images
  build-rust:
    uses: ./.github/workflows/build-and-dockerize.yaml
    with:
      imageTag: ${{ github.sha }}
      publishLatest: true
      targets: rust
      build: false
      publishPrComment: false
      uploadJavaScriptArtifacts: false
    secrets: inherit

  # Build and publish Rust crates and binaries
  rust:
    uses: ./.github/workflows/publish-rust.yaml
    secrets: inherit
    with:
      publish: true
