Skip to content

Instantly share code, notes, and snippets.

@dishao123
Created June 24, 2023 09:32
Show Gist options
  • Save dishao123/77d2f6bdda2b9e0b24e0673744bc2747 to your computer and use it in GitHub Desktop.
Save dishao123/77d2f6bdda2b9e0b24e0673744bc2747 to your computer and use it in GitHub Desktop.
利用 Gitlab Action 自动化构建并部署 Hexo 博客
image: node:18.15.0
cache:
paths:
- node_modules/
before_script:
- npm install hexo-cli -g
- test -e package.json && npm install
- hexo generate
pages:
script:
- hexo generate
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment