Update and automatic deploy on Cloud¶
Update Hexo¶
Install dependencies:
Generate:
Run 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
andfirebase.json
## 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 }}