更新每日一题 #143
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: Mblog 自动部署 | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Node.js 版本:${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: 安装 pnpm | |
run: npm install pnpm -g | |
- name: 安装依赖 | |
run: pnpm install | |
- name: 打包 | |
run: pnpm run build | |
# - name: 构建 pagefind 索引 | |
# run: npx pagefind --source docs/.vitepress/dist | |
- name: 部署到 Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
repository-name: i-mufeng/i-mufeng.github.io | |
clean: true | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
branch: action-pages | |
folder: docs/.vitepress/dist | |
- name: 部署到远程服务器 | |
uses: easingthemes/ssh-deploy@main | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_IMUFENG_KEY }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
ARGS: "-rlgoDzvc -i --delete" | |
SOURCE: "docs/.vitepress/dist/" | |
TARGET: ${{ secrets.REMOTE_TARGET }} |