diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index d3acdfd..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,38 +0,0 @@ - -name: Docker - -on: - workflow_run: - workflows: [Rust] - types: [completed] - branches: [main] - workflow_dispatch: - -jobs: - docker: - # This workflow defines how a maven package is built, tested and published. - # Visit: https://github.com/samply/github-workflows/blob/develop/.github/workflows/docker-ci.yml, for more information - uses: samply/github-workflows/.github/workflows/docker-ci.yml@main - with: - # The Docker Hub Repository you want eventually push to, e.g samply/share-client - image-name: "samply/rustyspot" - # image-tag-suffix: ${{ matrix.features && format('-{0}', matrix.features) }} - # Define special prefixes for docker tags. They will prefix each images tag. - # image-tag-prefix: "foo" - # Define the build context of your image, typically default '.' will be enough - # build-context: '.' - # Define the Dockerfile of your image, typically default './Dockerfile' will be enough - build-file: './Dockerfile' - # NOTE: This doesn't work currently - # A list of build arguments, passed to the docker build - # build-args: | - # FEATURE=-${{ matrix.features }} - # Define the target platforms of the docker build (default "linux/amd64,linux/arm64/v8") - # build-platforms: "linux/amd64" - # If your actions generate an artifact in a previous build step, you can tell this workflow to download it - # artifact-name: '*' - push-to: dockerhub - # This passes the secrets from calling workflow to the called workflow - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9b1d9a4..be3cae0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,33 +1,26 @@ -name: Rust +name: Build with rust and docker on: push: - branches: [main] workflow_dispatch: pull_request: - -env: - CARGO_TERM_COLOR: always - PROFILE: release + schedule: + # Fetch new base image updates every night at 1am + - cron: '0 1 * * *' jobs: - pre-check: - name: Security, License Check - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 - - rust: - name: Build (Rust) - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: | - cargo check --all-features - cargo test --all-features - cargo build --release + build-with-samply: + uses: samply/github-workflows/.github/workflows/rust.yml@main + with: + # For information on these variables, please refer to https://github.com/samply/github-workflows/tree/main/.github/workflows/rust.yml + # Docker Hub name will be {image-prefix}{component} + image-prefix: "samply/" + components: '[ "rustyspot" ]' + architectures: '[ "amd64" ]' + #profile: debug + test-via-script: false + #features: '[ "", "sockets" ]' + push-to: ${{ (github.ref_protected == true || github.event_name == 'workflow_dispatch') && 'dockerhub' || 'none' }} + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/rust_security.yml b/.github/workflows/rust_security.yml deleted file mode 100644 index 59f1ff0..0000000 --- a/.github/workflows/rust_security.yml +++ /dev/null @@ -1,11 +0,0 @@ -on: - schedule: - - cron: '0 3 * * 1' -jobs: - audit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file