Docs publish to github page trigger on push to docs branch (#1782)

Co-authored-by: Hien To <tominhhien97@gmail.com>
This commit is contained in:
hiento09 2024-01-25 21:18:45 +07:00 committed by GitHub
parent b291b3da71
commit 837fa8a82d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ on:
branches: branches:
- main - main
- dev - dev
- docs
paths: paths:
- 'docs/**' - 'docs/**'
- '.github/workflows/jan-docs.yml' - '.github/workflows/jan-docs.yml'
@ -12,6 +13,7 @@ on:
branches: branches:
- main - main
- dev - dev
- docs
paths: paths:
- 'docs/**' - 'docs/**'
- '.github/workflows/jan-docs.yml' - '.github/workflows/jan-docs.yml'
@ -91,13 +93,13 @@ jobs:
Preview URL: ${{ steps.deployCloudflarePages.outputs.url }} Preview URL: ${{ steps.deployCloudflarePages.outputs.url }}
- name: Add Custome Domain file - name: Add Custome Domain file
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pull_request.head.repo.full_name != github.repository if: github.event_name == 'push' && github.ref == 'refs/heads/docs' && github.event.pull_request.head.repo.full_name != github.repository
run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME
# Popular action to deploy to GitHub Pages: # Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pull_request.head.repo.full_name != github.repository if: github.event_name == 'push' && github.ref == 'refs/heads/docs' && github.event.pull_request.head.repo.full_name != github.repository
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}