From 0e3919a6b851db9d34f92e050ef1e55a6bde4d08 Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Sun, 16 Jun 2024 11:38:36 +0200 Subject: [PATCH] Setup GHA workflow to publish docs using mdbook --- .github/workflows/haskell.yml | 25 +++++++++++++++++++++++-- docs/.gitignore | 1 + docs/book.toml | 6 ++++++ docs/src/SUMMARY.md | 3 +++ docs/src/chapter_1.md | 1 + 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/book.toml create mode 100644 docs/src/SUMMARY.md create mode 100644 docs/src/chapter_1.md diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index b80218a8..6a124f90 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -1,9 +1,8 @@ name: Haskell CI on: - push: - branches: [ "main" ] pull_request: + push: branches: [ "main" ] permissions: @@ -67,3 +66,25 @@ jobs: - name: ๐Ÿงช Run tests run: cabal test --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib all + + docs: + runs-on: ubuntu-latest +# if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - name: โœ… Checkout + uses: actions/checkout@v4 + + - name: ๐Ÿชจ Setup mdBook + uses: peaceiris/actions-mdbook@v2 + with: + mdbook-version: '0.4.40' + + - name: ๐Ÿ““ Build docs + run: mdbook build docs + + - name: ๐Ÿš€ Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book + cname: alba.cardano-scaling.org diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..7585238e --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +book diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 00000000..55c1b4c3 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Arnaud Bailly"] +language = "en" +multilingual = false +src = "src" +title = "ALBA" diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 00000000..7390c828 --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [Chapter 1](./chapter_1.md) diff --git a/docs/src/chapter_1.md b/docs/src/chapter_1.md new file mode 100644 index 00000000..b743fda3 --- /dev/null +++ b/docs/src/chapter_1.md @@ -0,0 +1 @@ +# Chapter 1