Title HugoとGitHub ActionsでGitHub Pagesを自動デプロイする。 GitHub Pagesを使用するには、Hugoでビルドした成果物をPushする必要があったが[github actions beta]では、リポジトリにPushする必要がなくなった。 Contents 手順 Githubにログイン GitHubのRepositoriesを選択する [Settings]-[Pages]-[Build and deployment] [github actions beta]を選択する。 Hugoのworkflowの[Configure]を選択する Workflowの内容を確認して[Commit changes…]をクリックする [github actions beta]を選択した後自動でHugo Wrokflowが表示されない場合 下の図の様に、推奨WorkflowにHugoが表示されない場合 [Use a suggested workflow, browse all workflows, or create your own. ]の[browse all workflows]をクリック [Search workflows]にHugoを入力する 表示されたHugo Workflowの[Configure]を選択する Hugo Wrokflowテンプレート # Sample workflow for building and deploying a Hugo site to GitHub Pages name: Deploy Hugo site to Pages on: # Runs on pushes targeting the default branch push: branches: ["main"] #mainブランチにPushした契機で動作する # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
Read More