mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 04:16:13 +00:00
Add pull_request event
- Add pull_request event - Add filter to deploy with a default branch only
This commit is contained in:
1 parent
0c33b05de5
commit
14199cff13
1 file changed
+4
-2
@@ -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.
|
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
|
```yml
|
||||||
name: github pages
|
name: github pages
|
||||||
@@ -56,6 +56,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # Set a branch to deploy
|
- main # Set a branch to deploy
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -77,12 +78,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./public
|
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
|
## Use a Custom Domain
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user