Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Add CI action to deploy book to GitHub pages. (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerjohn authored May 29, 2021
1 parent a32cba7 commit 89b56fb
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: github pages

on:
push:
branches:
- master
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.8'

- run: mdbook build docs

- name: Deploy latest
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
destination_dir: latest
if: github.ref == 'refs/heads/master'

- name: Get tag
id: branch_name
run: |
echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/tags/}
if: startsWith(github.ref, 'refs/tags')

- name: Deploy tag
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
destination_dir: ${{ steps.branch_name.outputs.BRANCH_NAME }}
if: startsWith(github.ref, 'refs/tags')

0 comments on commit 89b56fb

Please sign in to comment.