language: node_js
node_js:
- "node"
os: linux
dist: bionic
sudo: required
branches:
only:
- sources
git:
depth: 1
env:
global:
- secure: "{Something like hfwh747tbwcnybbvixc7xncgbxmshga9se72h}"
# Encrypt your Token as __GitOAuthToken__='{The_GitHub_Token}' format, and Paste here
cache:
apt: true
directories:
- node_modules
before_install:
- npm install -g hexo [email protected]
install:
- npm install
before_script:
- git config --global user.name '{GitUserName}' # Replace your GitHub Username
- git config --global user.email '{GitUserEMail}' # Replace your GitHub EMail Address
- sed -i "s/__GitOAuthToken__/${__GitOAuthToken__}/" _config.yml
script:
- hexo clean && hexo generate
after_success:
- hexo deploy --silent
For Deploy Section
deploy:
type: git
message: "Site updated: {{ now('YYYY-MM-DD HH:mm') }}"
repo:
github: https://[email protected]/{Organization}/{Organization}.github.io.git
# This should look like https://[email protected]/MyOrg/MyOrg.github.io.git
branch: master
__GitOAuthToken__ will be loaded from Travis environment variable and then replaced by sed into _config.yml just before Deployment. So, Just change the Organization Name here.
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/