Skip to content

Instantly share code, notes, and snippets.

@ChenYFan
Created March 27, 2022 16:53
Show Gist options
  • Save ChenYFan/bd4351b647867fd44baa6d1019a9ae5c to your computer and use it in GitHub Desktop.
Save ChenYFan/bd4351b647867fd44baa6d1019a9ae5c to your computer and use it in GitHub Desktop.
Hexo Action YML
name: HexoBlogBuild
on:
- push
jobs:
buildstatic:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install & Build
run: >
npm install -g hexo-cli
npm i
# Restore last modified time
git ls-files -z | while read -d '' path; do touch -d "$(git log -1
--format="@%ct" "$path")" "$path"; done
hexo g
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.TOKEN }}
publish_dir: ./public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment