Build and deploy vim help #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy vim help | |
# gh-pagesブランチを経由せず、actions/upload-pages-artifactを使って直接GitHub Pagesにデプロイする | |
# pushのたびにいったん artifacts まで作る(HTML生成+Jekyll実行) | |
# masterへのpushかcronでの実行であればGitHub Pagesへアップロードする | |
on: | |
push: | |
schedule: | |
- cron: '5 12 * * *' | |
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/*.html | |
# | |
# 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/ | |
retention-days: 7 | |
# Upload a site to GitHub Pages | |
deploy: | |
needs: | |
- build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Run only when updating the master branch or when started by cron. | |
if: github.ref == 'refs/heads/master' || github.event_name == 'schedule' | |
steps: | |
- name: Deploy to Github Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |