Skip to content

Commit

Permalink
doc: Build and deploy documentation on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nrybowski committed Nov 25, 2024
1 parent f4ea608 commit 67f07bb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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
echo "<meta http-equiv=\"refresh\" content=\"0; url=dune_core\">" > target/doc/index.html
- name: Upload documentation
id: deploy
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
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
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [ "rust" ]
branches: [ "main" ]
pull_request:
branches: [ "rust" ]
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 67f07bb

Please sign in to comment.