GitHub Pages and GitHub Actions

GitHub Actions による GitHub Pages へのデプロイ

元記事は github.com

最終更新: 2021-06-18

ソースを表示 編集
GitHub Actions による GitHub Pages へのデプロイ

目次

GitHub Actions for GitHub Pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site with Static Site Generators peaceiris/actions-gh-pages

This is a GitHub Action to deploy your static files to GitHub Pages. This deploy action can be combined simply and freely with Static Site Generators (Hugo, mdBook, MkDocs, Gatsby, GitBook, etc.).

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    publish_dir: ./public

The above example step will deploy ./public directory to gh-pages branch.

Example workflow

Here is an example workflow for Hugo project. Creat YAML file .github/workflows/gh-pages.yml and push to your remote default branch.

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    publish_dir: ./public

comments powered by Disqus

こちらもいかが?