chore: add hexo-tag-embed #161
This file contains 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: Deploy | |
on: | |
push: | |
branches: [ source ] | |
pull_request: | |
branches: [ source ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
TZ: 'Asia/Shanghai' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: 'recursive' | |
- name: Lint Code Base | |
uses: github/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MARKDOWN_CONFIG_FILE: .markdown-lint.json | |
VALIDATE_NATURAL_LANGUAGE: false | |
VALIDATE_GITHUB_ACTIONS: false | |
# - name: Check Markdown links | |
# uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
# with: | |
# folder-path: 'source/' | |
# config-file: '.github/linters/mlc_config.json' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.17.1' | |
- name: Setup Hexo | |
env: | |
GH_ACTION_DEPLOY_KEY: ${{ secrets.GH_ACTION_DEPLOY_KEY }} | |
run: | | |
git config --global user.name "howiezhao" | |
git config --global user.email "[email protected]" | |
mkdir -p ~/.ssh/ | |
echo "$GH_ACTION_DEPLOY_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
# Ref: https://theme-next.js.org/docs/getting-started/deployment.html | |
git ls-files -z | while read -d '' path; do touch -d $(git log -1 --format=@%ct $path) $path; done | |
git clone [email protected]:howiezhao/howiezhao.github.io.git .deploy_git | |
npm install -g hexo-cli | |
npm install | |
- name: Deploy | |
run: | | |
hexo g | |
hexo d |