Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

ldez/travis-continuous-delivery-hugo-publish

Repository files navigation

Travis continuous delivery

Build Status

This project explains how to manipulate a Git repository within Travis CI to publish a static site build with Hugo on GitHub Page.

SSH way (recommended)

Generating SSH keys and encryption

See travis-secure-key.sh

Adding a new SSH key to your GitHub account

In this case you can assume to don't define a passphrase for the SSH key.

Encrypt SSH key:

GitHub token (optional)

Get a Personal Access Token.

Only enable public_repo access for public repositories, repo for private. Save the token somewhere as you can only see it once.

Use SSH key

See publish.sh

Skip Build

Commit message

Travis automatically skips the build if the commit contains [ci skip].

Example:

git commit -m 'My commit message [ci skip]'

Travis variables

You can skip build by defined `` variable.

Scaffolding

Install Hugo

git init travis-continuous-delivery-hugo-publish
cd travis-continuous-delivery-hugo-publish

git checkout -b source

cd ..
hugo new site travis-continuous-delivery-hugo-publish --force

cd travis-continuous-delivery-hugo-publish

hugo new post/first-post.md
echo 'Some text.' >> content/post/first-post.md

Build configuration

You must defined environement variables via Travis:

  • USER_EMAIL : Git user email
  • USER_NAME : Git user name

About

Travis continuous delivery - Hugo - Only for testing purpose

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages