![Deplying your github website with Travis](/assets/images/7-Travis_GHPages/travis-main.png)
Ipsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraphIpsum loren some random paragraph
There should be .travis.yml
file in the sources/project directory so that it automatically triggers a build when you push it ; and deploys to the ` master` branch upon a successful build.
So , now go to https://travis-ci.org ; link your github account and turn on the repository containing your project files/where you want to deploy.
See the .travis.yml
below.
get the GITHUB TOKEN from your github account > settings > development > tokens
and save it in the ENV _VARIABLES
of the dashboard of that repository.
in the _config.yml
of your jekyll site add the following line.
exclude:
- vendor
this must be in your
_config.yml
file because travis installs the gems in the./vendor/bundle
folder.
else that would always break builds like this and your site wont be built properly.
.travis.yml
FILE
#This is travis script to auto build the site on #source branch and deploy to mster branch
language: ruby
# add a ruby container
rvm:
- 2.4.1
cache: bundler
-
#what should be done in the VM before install
before_install:
- gem update --system
- gem install bundler
-
#what to install and what script to run
#script contains : bundle install
# bundle exec jekyll build
script: ./CI/travis.sh
#this is to deploy from "sources" branch to "master" branch ; change on and target accordingly
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
on:
branch: sources
local_dir: _site
target_branch: master
and traviscibot
will deploy successfully.
who am I, if not the blue pale dot in this utopian battlefield of barabaric bureaucracy. My faint and momentary thoughts quench on all things logical and quantum.