Skip to content

fix gh-pages action #16

fix gh-pages action

fix gh-pages action #16

Workflow file for this run

name: Github Pages 🌐
on:
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
- '.github/ISSUE_TEMPLATE/*'
- '*.md'
- '*.nimble'
- '.gitignore'
- 'LICENSE'
permissions:
contents: write
jobs:
live_demo:
runs-on: ubuntu-latest
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@v4
with:
node-version: ${{ env.node_version }}
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v4
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: |
npm install uglify-js -g
npm install --global pageres-cli
nimble refresh
nimble install happyx -y
- name: Build HappyX-UI Demo example 🌐
timeout-minutes: 2
run: |
cd tests
nim js -d:danger --opt:size --hints:off --warnings:off test
uglifyjs test.js -c -m --mangle-props regex=/N[ST]I\w+/ -o test.js
- name: Deploy documents πŸ’¨
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tests
if: github.ref == 'refs/heads/master'
- name: Screenshot Website
run: |
rm rf -f screenshot.png
pageres https://hapticx.github.io/happyx-ui/#/ --delay=5 --filename='screenshot'
- name: Commit screenshot πŸ”¨
run: |
ls
git config --local user.email ${{ secrets.BOT_EMAIL }}
git config --local user.name "github-actions [bot]"
git add screenshot.png --quiet
git commit -m "[bot] update screenshot.png" --quiet
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.SECRET_TOKEN }}