升级依赖,统一标签,移除无用内容 #499
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, repository_dispatch] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 载入文件 | |
uses: actions/checkout@v3 | |
with: | |
submodules: true # Checkout private submodules(themes or something else). 当有子模块时切换分支? | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Setup Node.js 22.x | |
uses: actions/setup-node@main | |
with: | |
node-version: 22 | |
registry-url: https://registry.npmjs.org | |
- name: 设置 Hexo 环境 | |
env: | |
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }} | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
git config --global user.name 'MCSeekeri' | |
git config --global user.email 'mcseekeri@github.com' | |
git ls-files -z | while read -d '' path; do touch -d $(git log -1 --format="@%ct" "$path") "$path"; done | |
npm i -g hexo-cli yarn gulp-cli | |
yarn | |
- name: 部署页面并提交搜索引擎 | |
env: | |
BAIDU_TOKEN: ${{ secrets.BAIDU_TOKEN }} | |
BING_TOKEN: ${{ secrets.BING_TOKEN }} | |
GOOGLE_TOKEN: ${{ secrets.GOOGLE_TOKEN }} | |
run: | | |
echo "$GOOGLE_TOKEN" | tr -d '\r' >> $GITHUB_WORKSPACE/push.json | |
hexo generate && gulp && hexo deploy | |
# - name: 部署到 Cloudflare Workers | |
# uses: cloudflare/wrangler-action@1.3.0 | |
# with: | |
# apiToken: ${{ secrets.CF_WORKERS_TOKEN }} |