Skip to content

no message

no message #22

Workflow file for this run

name: Deploy Hexo-theme-snippet to GitHub Pages
on:
push:
branches: [dev]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
TZ: Asia/Shanghai
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Hexo and dependencies
run: |
npm install -g hexo-cli gulp-cli
npm install
- name: Build static files
run: |
hexo clean
hexo generate
gulp # 执行 Gulp 构建任务
- name: Create deployment info file
run: |
time=$(date '+%Y-%m-%d %H:%M:%S %Z')
cat <<EOF >> public/README.md
## 自动部署集成日志
部署状态 | 集成结果 | 参考值
---|---|---
完成时间 | $time | yyyy-mm-dd hh:mm:ss
部署环境 | $RUNNER_OS + node-${{ env.npm_config_node_version }} | windows \| linux \| macos + node-version
部署类型 | ${{ github.event_name }} | push \| pull_request \| workflow_dispatch
仓库地址 | ${{ github.repository }} | owner_name/repo_name
提交分支 | ${{ github.sha }} | commit hash
提交信息 | ${{ github.event.head_commit.message }} |
Workflow ID | ${{ github.run_id }} |
Workflow NUM | ${{ github.run_number }} |
EOF
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages