Skip to content

添加 index.md

添加 index.md #62

Workflow file for this run

name: Blog CI/CD
on:
push:
branches:
- main # 只在main上push触发部署
paths-ignore: # 下列文件的变更不触发部署
- README.md
- LICENSE
jobs:
build-production:
runs-on: ubuntu-latest # 使用ubuntu系统镜像运行自动化脚本
steps: # 自动化步骤
- name: Installing node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v2 # 第一步,检出仓库副本
- name: Install dependencies # 第二步,安装依赖
run: npm install
- name: Build # 第三步,打包代码
run: npm run build --if-present
- name: Deploy to Server_ # 第四步,部署到服务器
uses: AEnterprise/[email protected]
env:
DEPLOY_KEY: ${{ secrets.SSH_TOKEN }}
ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件
SERVER_PORT: '22'
FOLDER: ./dist/* # 要推送的文件夹,路径相对于代码仓库的根目录
SERVER_IP: ${{ secrets.SSH_HOST }}
USERNAME: ${{ secrets.SSH_USERNAME }}
SERVER_DESTINATION: /root/blog/dist/ # 部署到目标文件夹
#- name: Process md File # 第五步,处理MD文件
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_TOKEN }}
# # 重启的脚本,根据自身情况做相应改动,一般要做的是migrate数据库以及重启服务器
# script: |
# echo '1'