Add pull_request event

- Add pull_request event
- Add filter to deploy with a default branch only
This commit is contained in:
Shohei Ueda
2021-05-17 23:43:52 +09:00
committed by Bjørn Erik Pedersen
parent 0c33b05de5
commit 14199cff13
@@ -47,7 +47,7 @@ This is a much simpler setup as your Hugo files and generated content are publis
GitHub executes your software development workflows. Everytime you push your code on the Github repository, Github Actions will build the site automatically.
Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on https://github.com/marketplace/actions/hugo-setup ):
Create a file in `.github/workflows/gh-pages.yml` containing the following content (based on [actions-hugo](https://github.com/marketplace/actions/hugo-setup)):
```yml
name: github pages
@@ -56,6 +56,7 @@ on:
push:
branches:
- main # Set a branch to deploy
pull_request:
jobs:
deploy:
@@ -77,12 +78,13 @@ jobs:
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
```
For more advanced settings https://github.com/marketplace/actions/hugo-setup
For more advanced settings [actions-hugo](https://github.com/marketplace/actions/hugo-setup) and [actions-gh-pages](https://github.com/marketplace/actions/github-pages-action).
## Use a Custom Domain