Skip to content

build a site with jekyll and upload it as an artifact #7

build a site with jekyll and upload it as an artifact

build a site with jekyll and upload it as an artifact #7

name: Build and deploy vim help
# This is an experimental.
#
# gh-pagesブランチを経由せず、actions/upload-pages-artifactを使って直接GitHub Pagesにデプロイする試み
# pushのたびにいったん artifacts まで作る(HTML生成+Jekyll実行)
# masterへのpushかcronでの実行であればGitHub Pagesへアップロードする
# …という計画
on:
push
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Setup Vim
uses: thinca/action-setup-vim@v2
with:
vim_version: 'v9.1.0065'
vim_type: 'Vim'
- name: Checkout
uses: actions/checkout@v4
#
# Generate HTML from Vim documents and upload it as an artifact.
#
- name: Generate new HTML documents
run: |
make html
- name: Check commit IDs
id: commitid
run: |
echo "vim=$(git -C vim rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "vim_faq=$(git -C vim_faq rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Upload vim generated HTML files as an artifact
uses: actions/upload-artifact@v4
with:
name: vim-generated-html
path: target/html/doc
#
# Generate GitHub Page site and upload it as an artifact.
#
- name: Prepare for building GitHub Page (Jekyll)
run:
make jekyll-build-prepare
- name: Build GitHub Page site
uses: actions/jekyll-build-pages@v1
with:
source: target/jekyll-work
verbose: true
- name: Upload a site as an artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site/
retantion-days: 7
# TODO: masterへのpushもしくはcron実行のときだけ、GitHub Pagesへアップロードする