Skip to content

Commit

Permalink
优化发布的流程
Browse files Browse the repository at this point in the history
  1. 更新软件的版本,对已弃用的配置选项进行了修改
  2. 取消与密钥相关的设置,因为在当前仓库上发布网页无需使用它们
  • Loading branch information
shzhxh committed Jan 19, 2023
1 parent 037742b commit 82fa511
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 67 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,31 @@ on:
pull_request:
branches: [ master ]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-20.04
build-and-deploy:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: npm install
- uses: actions/checkout@v3

- name: check node.version
run: node --version
- name: check npm.version
run: npm --version
- uses: actions/setup-node@v3
with:
node-version: 16

- name: prepare build env
env:
GH_ACTION_DEPLOY_KEY: ${{secrets.GH_ACTION_DEPLOY_KEY}}
NEXT_VERSION: v7.3.0
- name: build
run: |
mkdir -p ~/.ssh/
echo "$GH_ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name 'wyfcyx'
git config --global user.email '[email protected]'
node --version
npm --version
npm i -g hexo-cli
npm i
hexo --version
- name: deploy to github
run: |
pwd
ls
npm install hexo --save
hexo --version
npm install hexo-deployer-git --save
npm install https://github.com/CodeFalling/hexo-asset-image -- save
\cp tools/index.js node_modules/hexo-asset-image/index.js
npm un hexo-renderer-marked --save
# npm i hexo-renderer-pandoc --save
npm i hexo-renderer-kramed --save
hexo clean
hexo generate
hexo deploy
- name: deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: public
8 changes: 3 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ meta_generator: true
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'date'

# Pagination
## Set per_page to 0 to disable pagination
Expand All @@ -98,6 +98,4 @@ theme: next
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: [email protected]:rcore-os/blog.git
branch: gh-pages
type: ''
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "4.2.1"
},
"dependencies": {
"hexo": "^4.2.1",
"hexo-asset-image": "^1.0.0",
"hexo-cli": "^3.1.0",
"hexo-deployer-git": "^2.1.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0"
}
}
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "4.2.1"
},
"dependencies": {
"hexo": "^4.2.1",
"hexo-asset-image": "^1.0.0",
"hexo-cli": "^3.1.0",
"hexo-deployer-git": "^2.1.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0"
}
}

0 comments on commit 82fa511

Please sign in to comment.