Skip to content

node_module

node_module #7

Workflow file for this run

name: Deploy blog
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: prepare node env
uses: actions/setup-node@v1
with:
node-version: "18.18.0"
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: set github profile
run: |
git config --global user.name 'Deepcity'
git config --global user.email 'f1159472899@163.com'
- name: hexo generate
run: |
npm i -g hexo
npm i
hexo clean && hexo g && hexo d
- name: ssh remove server
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
cd blog
git pull origin master --rebase
sudo nginx -s reload