Preface
Goal: Overview of deploying SSG in repository.
How many ways to deploy your static site? I found at least ten ways to deploy SSG site.
We are going to to learn how to be a junior devops, to be precise, a YAML Engineer.
Manual Page
This guidance is intended for beginner. Professional should read manual page instead 🙂.
Issue
I already have three blogs. And I want to make my fourth one.
I desire to consider something else. Because I have already use github pages, gitlab pages and netlify.
One of the issue with SSGs is build minute. So I decide to experiment with methods I never use before.
Minutes Build on Free Plans
-
Github Free Plan
- https://help.github.com/en/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions
- Build Limit: 2000 minutes/months
-
Gitlab CI/CD Free Plan
- https://about.gitlab.com/pricing/
- Build Limit: 2,000 CI pipeline minutes per group per month on our shared runners
-
Bitbucket Pipelines Free Plan
- https://bitbucket.org/product/pricing
- Build Limit: 50 minutes/months
-
Netlify Free Plan
- https://www.netlify.com/pricing/
- Build Minutes: 300 included/month
-
Zeit Now Free Plan
- https://zeit.co/pricing
- Build Limit: Unknown? 2 Hours per Month.
-
Travis Free Plan
- https://travis-ci.com/plans
- Build Limit: Unlimited build minutes
-
CircleCI Free Plan
- https://circleci.com/pricing/
- Build Limit: Users on our Free plan can build up to 250 minutes per week using their 2,500 credits.
I do not really understand for each terms. I just put it there, so I can find it easily later on.
Choice: Deploying Method
How many ways to deploy your static site? I found at least ten ways to deploy SSG site.
Easiest One
My first SSG is Jekyll.
- Plain github (jekyll only)
Successfully Deployed
How about other SSGs ? I have successfully tested this six ways for these SSG: Jekyll, Hexo, Hugo, 11ty, Pelican.
- Gitlab CI
- Netlify
- Manual git push
- Zeit Now
- Manual git worktree
- Travis (github only)
- Circle-ci + github (git worktree)
- Circle-ci + bitbucket (git worktree)
- gh-action (github workflow)
- local git hook (.git/hooks)
On Radar
No Idea
I’m still not sure about this.
- Jenkins
You might have different idea, outside these above.
Articles
Consider to discuss it one by one.
0: Github Pages
I have already make article for this. There is no need to write another article.
0: Gitlab Pages
All available Hugo versions are listed here:
Still using the article above, here is my .gitlab-ci.yml.
image: registry.gitlab.com/pages/hugo:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
pages:
script:
- hugo --baseURL="http://oto-spies.info/"
artifacts:
paths:
- public
only:
- master
By this time of this writing. I still do not know If there is a free bitbucket pages.
1: Netlify
I also have made article to deploy Hexo using netlify.
The same steps apply to other SSG for example this 11ty.
Here is the netlify.toml example for the site aboce.
[build]
base = "tutor-06"
publish = "tutor-06/dist"
command = "eleventy"
Taht you can see ini this repository:
By this time of this writing. I do not have any luck in dploying Pelican in netlify. It seems like netlify is still using Python 2.7 instead of Python 3.x series. But maybe it is just me that doesn’t know how to configure it properly.
2: Manual Push
This is a very basic stuff. Introducing gh-pages
branch.
3: Zeit Now
Now, Zeit. We have this new article.
This article is a kind of for dummies guidance. We will explore more complex case, that can make you feel like an expert, using other tools later.
4: Manual Git Worktree
In a nutshell, git worktree
enable you to work,
with different branches in a same time.
This is a so long topic that should be covered in two articles.
5: Travis
Travis CI read your source SSG from master branch from your repository,
build your site, write your pages to gh-pages
.
Another long topic that should be covered in two articles.
6: CircleCI + Github
Just like Travis, but combining with git worktree
.
Interesting topic that deserved two articles.
7: CircleCI + Bitbucket
Just like previous Tier, but using Bitbucket. We need some adjustment about SSH management.
I also use different branch scheme other than master
and gh-pages
.
8: Github Workflows
How about going back to Github? This time we are going to explore Github Actions
In a nutshell Github Workflows is
-
Configuration
-
Reusable Script
Github Actions has a lot of potential.
9: Git Hooks
This is just another manual CI/CD for intellectual curiosity. This is not recommended for daily use.
When you push master branch.
The screen is showing push to gh-pages
instead.
What is Next ?
Consider continue reading [ CI/CD - Manual Git ].
Using git
manually, featuring git refspec
.