Skip to content

Instantly share code, notes, and snippets.

@tk3
Last active May 10, 2020 12:43
Show Gist options
  • Save tk3/e348eacd324cc853ba7401daf6aafa59 to your computer and use it in GitHub Desktop.
Save tk3/e348eacd324cc853ba7401daf6aafa59 to your computer and use it in GitHub Desktop.
Hugo のコンテンツを Github Actions で GitHub Pages にデプロイする

source ブランチには hugo のコンテンツを置き、それらを Github Actions でブログに変換して、生成したものは master ブランチに push する。

git clone [email protected]:tk3/tk3.github.io.git
cd tk3.github.io/
:> README.md
git add README.md
git commit -m 'first commit'
git push origin master


git checkout -b source origin/master
git push origin source


cd ../
hugo_extended_0.68.3 new site hugo_tmp
cp -r hugo_tmp/* tk3.github.io/
cd tk3.github.io/

:> content/.gitkeep
:> data/.gitkeep
:> layouts/.gitkeep
:> static/.gitkeep
:> themes/.gitkeep

git add archetypes/default.md
git add config.toml
git add content/.gitkeep
git add data/.gitkeep
git add layouts/.gitkeep
git add static/.gitkeep
git add themes/.gitkeep
git commit -m 'add template files'


vi config.toml
git add config.toml
git commit -m 'modify config'


git submodule add https://github.com/alex-shpak/hugo-book themes/book
git commit -m 'add `book` theme'


mkdir -p .github/workflows/
:> .github/workflows/gh-pages.yml
vi .github/workflows/gh-pages.yml
git add .github/workflows/gh-pages.yml
git commit -m 'add config file for GitHub Actions'


git push origin HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment