todolist更新 #673
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: 打包应用并上传服务器 | |
on: | |
push: | |
# push 代码的时候 哪个分支会受到影响 这里是 master 主分支 | |
branches: | |
- master | |
workflow_dispatch: | |
# 推送之后执行一系列的任务 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 获取代码 | |
- name: 迁出代码 | |
# 使用action库 action/checkout获取大妈 | |
uses: actions/checkout@master | |
# 安装Node10 | |
- name: 安装node.js | |
# 使用action库 actions/setup-node安装node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.13.2 | |
- name: 安装yarn | |
run: npm install -g yarn | |
# 安装依赖 | |
- name: 安装依赖 | |
run: yarn | |
# 打包 | |
- name: 打包 | |
run: yarn docs:build | |
# 上传到阿里云 | |
- name: 发布到阿里云 | |
uses: easingthemes/[email protected] | |
env: | |
# 私钥 | |
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
# SCP参数 | |
ARGS: '-avzr --delete' | |
# 源目录 | |
SOURCE: 'docs/.vitepress/dist' | |
# 服务器ip | |
REMOTE_HOST: ${{ secrets.PRIVATE_HOST }} | |
# 用户 | |
REMOTE_USER: 'root' | |
# 目标地址 | |
TARGET: '/www/server/nginx/html/blog' | |
# 推送信息到微信 | |
- name: 推送信息到微信 | |
uses: easychen/github-action-server-chan@main | |
with: | |
sendkey: ${{ secrets.PRIVATE_FANGTANG_KEY }} | |
title: '网站更新完毕' |