Create Cursor代码神器之——创建uni-app项目(6).md #3197
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: Hexo Auto-Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Hexo Auto-Deploy by GitHub Actions | |
runs-on: ubuntu-latest | |
steps: | |
- name: 1. git checkout... | |
uses: actions/checkout@v4 | |
- name: 2. setup nodejs... | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: 3. Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: 4. Install hexo dependencies | |
run: | | |
npm install hexo-cli -g | |
npm install | |
- name: 5. hexo generate public files... | |
run: | | |
hexo clean | |
hexo generate | |
- name: 6. hexo deploy ... | |
env: | |
# Github 仓库 | |
GITHUB_REPO: github.com/PGzxc/PGzxc.github.io.git | |
# Coding 仓库 | |
CODING_REPO: e.coding.net/pgzxc/pgzxc/pgzxc.git | |
# 将编译后的博客文件推送到指定仓库 | |
run: | | |
cd ./public && git init && git add . | |
git config --global user.name "PGzxc" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "GitHub Actions Auto Builder at $(date +'%Y-%m-%d %H:%M:%S')" | |
git push --force --quiet "https://${{ secrets.ACCESS_TOKEN }}@$GITHUB_REPO" master:hexo | |
# git push --force --quiet "https://JcwUpKlfjB:${{ secrets.CODING_TOKEN }}@$CODING_REPO" master:hexo |