Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tony green committed Nov 10, 2023
1 parent e5051ed commit c3dc080
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@ on:
push:
branches:
- master

env:
SERVER_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }} # 服务器私钥
SERVER_HOST: ${{ secrets.HOST }} # 服务器IP地址
USER_NAME: ${{ secrets.NAME }} # 服务器用户名
cache-name: blog

jobs:
build:
runs-on: ubuntu-latest
@@ -17,6 +24,21 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 14
#缓存依赖
- name: Cache nodemodules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
# 需要缓存的文件的路径
path: ./node_modules
# 对缓存的文件指定的唯一标识
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package.json') }}
# 用于没有再找目标key的缓存的backup选项
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# npm install
- name: npm install and build
run: |
@@ -28,9 +50,9 @@ jobs:
- name: Deploy aliyun
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }}
SSH_PRIVATE_KEY: ${{ env.SERVER_PRIVATE_KEY }}
ARGS: "-avz --delete"
SOURCE: "./docs/.vuepress/dist/"
REMOTE_HOST: "47.116.12.164"
REMOTE_USER: "root"
REMOTE_HOST: ${{ env.SERVER_HOST }}
REMOTE_USER: ${{ env.USER_NAME }}
TARGET: "/www/blog2222"

0 comments on commit c3dc080

Please sign in to comment.