From 75c45b0ab8034ec1fc4c29e2d80e377db0f89b64 Mon Sep 17 00:00:00 2001 From: Nicolas Rybowski Date: Mon, 25 Nov 2024 21:29:56 +0100 Subject: [PATCH] doc: Build and deploy documentation on github pages --- .github/workflows/doc.yml | 40 ++++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 4 ++-- README.md | 1 + 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/doc.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..e2ea284 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,40 @@ +# This is a basic workflow to help you get started with Actions + +name: Documentation + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build_doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - name: Build documentation + id: build + run: cargo +nightly doc + - name: Upload documentation + id: deploy + uses: actions/upload-pages-artifact@v3 + with: + path: target/doc/dune_core + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build_doc + permissions: + pages: write + id-token: write + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 722b8a3..e632855 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,9 @@ name: Build on: push: - branches: [ "rust" ] + branches: [ "main" ] pull_request: - branches: [ "rust" ] + branches: [ "main" ] env: CARGO_TERM_COLOR: always diff --git a/README.md b/README.md index 267ed1e..9193dca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![MIT licensed][mit-badge]][mit-url] ![CI Build](https://github.com/nrybowski/dune/actions/workflows/rust.yml/badge.svg) +![Documentation](https://github.com/nrybowski/dune/actions/workflows/doc.yml/badge.svg) [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: https://github.com/nrybowski/dune/blob/master/LICENSE