跳转至

Update and automatic deploy on Cloud

Update Hexo

Install dependencies:

$ git clone https://github.com/hexojs/site.git
$ cd site
$ yarn install #using yarn rather than npm

Generate:

$ hexo generate

Run server:

$ hexo server

Change source and theme folder. It's odd, need to create folder under source\themes, name it as screenshot

Deploy

To github

$ git remote rm origin
$ git init
$ git add .
$ git commit -m "first commit"
$ git remote add origin https://github.com/faystart/npfml-gen.git
$ git push

on Vercel and Netlify, just deploy.

to Firebase:

  • .firebaserc and firebase.json
##.firebaserc
{
  "projects": {
    "default": "npfmlib"
  }
}
## firebase.json

{
  "hosting": {
    "public": "public",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "headers": [
      {
        "source": "**/*.@(jpg|jpeg|gif|png|svg|ico)",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "no-cache"
          }
        ]
      },
      {
        "source": "**/*.@(js|css)",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "max-age=31536000"
          }
        ]
      }
    ]
  }
}

workflows:

name: Deploy to Firebase

on:
  push:
    branches: [ master ]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Install Dependencies
        run: npm install

      - name: Build
        run: npm run build

      - name: Deploy to Firebase
        uses: w9jds/firebase-action@master
        with:
          args: deploy --only hosting
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
回到页面顶部