Created
March 27, 2022 16:53
-
-
Save ChenYFan/bd4351b647867fd44baa6d1019a9ae5c to your computer and use it in GitHub Desktop.
Hexo Action YML
This file contains hidden or 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
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