diff --git a/.github/workflows/publish-rust-apidocs.yml b/.github/workflows/publish-rust-apidocs.yml new file mode 100644 index 0000000000000..4e48a52e4a517 --- /dev/null +++ b/.github/workflows/publish-rust-apidocs.yml @@ -0,0 +1,43 @@ +name: Update Rust API Docs +on: + push: + branches: + - main + paths: + - rust + workflow_dispatch: + + +jobs: + publish: + name: Generate Rust docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install tools + run: | + sudo apt-get update + sudo apt-get install rustc + - name: Run rust docs generation + run: | + cd rust + cargo doc --no-deps + - name: Set commit ID + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - uses: actions/checkout@v2 + with: + ref: gh-pages + clean: false + - name: Move API docs into target area + run: | + rm -rf docs/api/rust + mv rust/target/doc docs/api/rust + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + branch: gh-pages-rustdocs-pr + base: gh-pages + title: '[Automated]: Update Rust API docs' + commit-message: 'Update Rust API docs to commit ${{ steps.vars.outputs.sha_short }}' + add-paths: docs/api/rust