feat: 更新 #210
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 | |
# 触发条件:在 push 到 master 分支后 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
push-to-gh-pages: | |
if: "contains(github.event.head_commit.message, '[deploy]')" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.2.0] | |
steps: | |
# 拉取代码 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: rm yml | |
run: | | |
rm -rf pnpm-lock.yaml | |
rm -rf docs/.vuepress/.cache/ | |
rm -rf docs/.vuepress/.temp/ | |
rm -rf docs/.vuepress/dist/ | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: true | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: Docs build | |
env: | |
NODE_OPTIONS: --max_old_space_size=8192 | |
run: | | |
pnpm install | |
pnpm run build | |
- name: deployments | |
uses: burnett01/[email protected] | |
with: | |
# 这里是 rsync 的参数 switches: -avzh --delete --exclude="" --include="" --filter="" | |
switches: -avzh | |
path: docs/.vuepress/dist/ | |
remote_path: /data_prod/webapp/lamp-doc/dist/ | |
remote_host: ${{ secrets.MY_CENTOS_HOST }} | |
remote_port: ${{ secrets.MY_CENTOS_PORT }} | |
remote_user: ${{ secrets.MY_CENTOS_USERNAME }} | |
remote_key: ${{ secrets.MY_CENTOS_RSA_PRIVATE_KEY }} |