Skip to content

v3.11.0 (#267 from HapticX/dev) #756

v3.11.0 (#267 from HapticX/dev)

v3.11.0 (#267 from HapticX/dev) #756

Workflow file for this run

name: Github Pages 🌐
on:
push:
branches:
- 'master'
paths-ignore:
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
- '**/FUNDING.yml'
- '**/tests.yml'
- '**/examples.yml'
- '**/language_bindings.yml'
- '**/jvm_bindings.yml'
permissions:
contents: write
jobs:
before:
runs-on: windows-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "not contains '[skip ci]'"
docs:
runs-on: windows-latest
needs: before
env:
nim_version: '2.0.4'
node_version: '20'
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node_version }}
- name: Install uglify-js 👀
run: |
npm install uglify-js -g
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.nim_version }}
- name: Install Dependencies 🔃
run: |
nimble refresh
nimble install -y
- name: Generate API documents 📃
run: nim doc --index:on -d:docgen --project --out:docs --hints:off src/happyx.nim
- name: Build HappyX website 🌐
timeout-minutes: 2
run: |
cd ./examples/website/src/
nim js -d:production -d:release --opt:size --hints:off --warnings:off --out:main_full.js main
uglifyjs main_full.js -c -m --mangle-props regex=/N[ST]I\w+/ -o main.js
cd ../../..
mkdir ./docs/happyx/public/
mkdir ./docs/public/
cp ./examples/website/src/index.html ./docs/
cp ./examples/website/src/main.js ./docs/
cp ./examples/website/src/happyx/public/* ./docs/happyx/public/
cp ./examples/website/src/happyx/public/* ./docs/public/
- name: Deploy documents 💨
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
if: github.ref == 'refs/heads/master'