I am trying to configure github action to auto deploy hexo project.
The yml like below:
name: Blog Auto Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download Source file
uses: actions/checkout@v2
with:
ref: main # Specify the name of the branch where you store Hexo source files
- name: Prepare Node env
uses: actions/setup-node@v1
with:
node-version: "10.x" # This corresponds to your own nodejs version (10.12 tested well)
- name: Set Env
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Replace with Github_Token
run: |
git config --global user.name 'xx' # github用户名
git config --global user.email 'xx' # github邮箱
sed -i "s/GITHUB_ACCESS_TOKEN/$GITHUB_ACCESS_TOKEN/g" ./_config.yml
- name: Hexo
run:
npm install -g hexo-cli
npm install
npx Hexo clean
npx Hexo g -d
But, I got error below in github actions:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/Hexo - Not found
npm ERR! 404
npm ERR! 404 'Hexo@latest' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm timing npm Completed in 1695ms