Skip to content

Commit

Permalink
publish doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb committed Jul 17, 2020
1 parent 22d903f commit d8a329e
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: website

on: [push] # debugging only
#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/[email protected]
with:
nim-version: 'stable'
- name: Build and test
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
nimble build -Y
nimble test -Y
- name: Build doc
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
env
# HACK to set "-d:ssl" when running nimble dock.
mkdir -p $HOME/.cache/nim/googlesearch_d/runnableExamples/
echo "--define: ssl" > $HOME/.cache/nim/googlesearch_d/runnableExamples/googlesearch_examples.nims
echo "--define: ssl" > $HOME/.cache/nim/googlesearch_d/runnableExamples/googlesearch_examples1.nims
echo "--define: ssl" > $HOME/.cache/nim/googlesearch_d/runnableExamples/googlesearch_examples2.nims
echo "--define: ssl" > $HOME/.cache/nim/googlesearch_d/runnableExamples/googlesearch_examples3.nims
# Due to bug https://github.com/nim-lang/Nim/issues/14281, compile the documentation separately.
nimble doc --git.url:https://github.com/$GITHUB_REPOSITORY --git.commit:$RELEASE_VERSION src/googlesearch.nim
find .
mkdir -p ./public
mv googlesearch.html nimdoc.out.css ./public/
cd ./public/
ln -s ./googlesearch.html index.html
cd ../
- name: Deploy
if: success()
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: ./public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d8a329e

Please sign in to comment.