Merge pull request #18 from xyb/autodoc
using github actions to build documentation
This commit is contained in:
commit
1816cf2d10
|
@ -0,0 +1,62 @@
|
|||
name: website
|
||||
|
||||
#on: [push]
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Set output
|
||||
id: vars
|
||||
run: echo ::set-output name=tag::${GITHUB_REF:10}
|
||||
- name: Cache choosenim
|
||||
id: cache-choosenim
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.choosenim
|
||||
key: ${{ runner.os }}-choosenim-stable
|
||||
- name: Cache nimble
|
||||
id: cache-nimble
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.nimble
|
||||
key: ${{ runner.os }}-nimble-stable
|
||||
- uses: jiro4989/setup-nim-action@v1.0.2
|
||||
with:
|
||||
nim-version: 'stable'
|
||||
- name: Install libsnappy
|
||||
run: sudo apt-get install libsnappy1v5
|
||||
- name: Install leveldb c library
|
||||
run: |
|
||||
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb1d_1.22-3_amd64.deb
|
||||
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb-dev_1.22-3_amd64.deb
|
||||
sudo dpkg -i *.deb
|
||||
-
|
||||
name: Build
|
||||
env:
|
||||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
|
||||
run: |
|
||||
nimble build -Y
|
||||
nimble test -Y
|
||||
nimble doc --project --git.url:https://github.com/$GITHUB_REPOSITORY src/leveldb.nim --git.commit:$RELEASE_VERSION
|
||||
mkdir -p ./public
|
||||
mv src/htmldocs/* ./public/
|
||||
cd ./public/
|
||||
ln -s ./leveldb.html index.html
|
||||
cd ../
|
||||
-
|
||||
name: Deploy
|
||||
if: success()
|
||||
uses: crazy-max/ghaction-github-pages@v1.3.0
|
||||
with:
|
||||
target_branch: gh-pages
|
||||
build_dir: ./public
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue