chore: more mdbook ci stuff
This commit is contained in:
parent
f218fcfc96
commit
c1451e704d
|
@ -1,29 +1,46 @@
|
||||||
name: mdBook
|
name: mdBook
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
permissions:
|
||||||
deploy:
|
contents: read
|
||||||
runs-on: ubuntu-20.04
|
pages: write
|
||||||
concurrency:
|
id-token: write
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
|
# Allow one concurrent deployment
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v2
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
uses: peaceiris/actions-mdbook@v1
|
uses: peaceiris/actions-mdbook@v1
|
||||||
with:
|
with:
|
||||||
mdbook-version: "latest"
|
mdbook-version: "latest"
|
||||||
|
|
||||||
- run: mdbook build book
|
- run: mdbook build book -d ../_site
|
||||||
|
|
||||||
- name: Deploy
|
- name: Upload artifact
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: actions/upload-pages-artifact@v1
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
deploy:
|
||||||
with:
|
environment:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
name: github-pages
|
||||||
publish_dir: ./book/book
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v1
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
/target
|
/target
|
||||||
.idea
|
.idea
|
||||||
|
_site/
|
Loading…
Reference in New Issue