From 82fa511d147b7800b046f5976dac51e879457de5 Mon Sep 17 00:00:00 2001 From: shzhxh Date: Thu, 19 Jan 2023 14:05:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83=E7=9A=84?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=20=20=201.=20=E6=9B=B4=E6=96=B0=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E7=89=88=E6=9C=AC=EF=BC=8C=E5=AF=B9=E5=B7=B2?= =?UTF-8?q?=E5=BC=83=E7=94=A8=E7=9A=84=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=BF=AE=E6=94=B9=20=20=202.=20?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B8=8E=E5=AF=86=E9=92=A5=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=9B=A0=E4=B8=BA=E5=9C=A8?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E4=BB=93=E5=BA=93=E4=B8=8A=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E6=97=A0=E9=9C=80=E4=BD=BF=E7=94=A8=E5=AE=83?= =?UTF-8?q?=E4=BB=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-deploy.yml | 52 ++++++++++------------------- _config.yml | 8 ++--- package.json | 54 +++++++++++++++---------------- 3 files changed, 47 insertions(+), 67 deletions(-) diff --git a/.github/workflows/auto-deploy.yml b/.github/workflows/auto-deploy.yml index ac5082e8b21..3d09b6df2d3 100644 --- a/.github/workflows/auto-deploy.yml +++ b/.github/workflows/auto-deploy.yml @@ -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 'wyfcyx@users.noreply.github.com' + 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 diff --git a/_config.yml b/_config.yml index 62176455fcd..d3522ba992f 100644 --- a/_config.yml +++ b/_config.yml @@ -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 @@ -98,6 +98,4 @@ theme: next # Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: - type: git - repo: git@github.com:rcore-os/blog.git - branch: gh-pages + type: '' diff --git a/package.json b/package.json index 8d7e857f33c..27665f98a59 100644 --- a/package.json +++ b/package.json @@ -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" - } - } \ No newline at end of file + "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" + } +} \ No newline at end of file