fix(ci): Skip docs publishing for dependabot PRs #7753
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs | |
on: | |
pull_request: | |
branches: [master] | |
push: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
TERM: xterm-256color | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
RUSTUP_HOME: /tmp/rustup_home | |
if: ${{ !contains(github.event.pull_request.title, '[skip-ci]') && github.actor != 'dependabot[bot]' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Install: Rust toolchain" | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build docs | |
run: make doc | |
- name: Copy logo image | |
run: cp ./images/logo.svg ./target/doc/ | |
- name: Deploy | |
if: github.event_name == 'push' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/doc | |
cname: docs.gear.rs | |
force_orphan: true | |
user_name: "github-actions[bot]" | |
user_email: "github-actions[bot]@users.noreply.github.com" | |
- name: Deploy PR | |
if: github.event_name == 'pull_request' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/doc | |
destination_dir: pr-${{ github.event.number }} |