From 2cef9684d28907c9e1e00723184374c14a60e301 Mon Sep 17 00:00:00 2001 From: kiootic Date: Tue, 10 Oct 2023 11:36:46 +0800 Subject: [PATCH] Build docs pages --- .github/workflows/{build.yml => build.yaml} | 0 .github/workflows/docs.yaml | 43 +++++++++++++++++++ .../workflows/{release.yml => release.yaml} | 2 +- Makefile | 4 ++ 4 files changed, 48 insertions(+), 1 deletion(-) rename .github/workflows/{build.yml => build.yaml} (100%) create mode 100644 .github/workflows/docs.yaml rename .github/workflows/{release.yml => release.yaml} (98%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..8aa42d7 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,43 @@ +name: Deploy docs + +on: + push: + branches: [main] + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - run: | + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.30/mdbook-v0.4.30-x86_64-unknown-linux-gnu.tar.gz | tar xz + sudo mv mdbook /usr/bin/mdbook + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - run: make docs + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./book + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yaml similarity index 98% rename from .github/workflows/release.yml rename to .github/workflows/release.yaml index 72eb00e..883ad15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - '*' + - "*" permissions: contents: write diff --git a/Makefile b/Makefile index 1e50b54..0c04df0 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +.PHONY: docs +docs: + mdbook build + .PHONY: migration migration: ifndef NAME