Skip to content

✨ feat: resolves #265, add support for tranlated post #65

✨ feat: resolves #265, add support for tranlated post

✨ feat: resolves #265, add support for tranlated post #65

name: Deploy Demo Page
defaults:
run:
shell: bash
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}
- name: Prepare hexo demo source
run: |
mkdir demo
cd demo
git clone -b gh-source https://github.com/fi3ework/hexo-theme-archer.git .
npm install
- name: Move latest theme source files to hexo demo folder
run: |
cd demo
mkdir -p themes/archer
find .. -maxdepth 1 ! -path '..' ! -path '../demo' ! -path '../.git' -exec mv -t ./themes/archer/ {} +
- name: Build latest theme
run: |
cd demo/themes/archer
npm install
npm run build
- name: Generate static files
run: |
npm install -g hexo-cli
cd demo
hexo g
ls -lh public
- name: Publish
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./demo/public
force_orphan: true