-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |