diff --git a/.github/workflows/branch-name-check.yml b/.github/workflows/branch-name-check.yml index f3a415d2f7c..2f47dd5da5d 100644 --- a/.github/workflows/branch-name-check.yml +++ b/.github/workflows/branch-name-check.yml @@ -35,7 +35,7 @@ jobs: - name: Check branch name for develop PRs if: ${{ steps.branch-name-check.outputs.target-branch == 'develop' }} run: | - if [[ "${{ steps.branch-name-check.outputs.source-branch }}" =~ ^(main|feature/.*|hotfix/.*|release/[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then + if [[ "${{ steps.branch-name-check.outputs.source-branch }}" =~ ^(main|feature/.*|docs/.*|hotfix/.*|release/[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?)$ ]]; then echo "Branch name is valid" else echo "Invalid branch name. Branches must follow the GitFlow naming convention to be allowed to merge into the develop branch." diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c5a04fa63e2..ac1e4c292f5 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -5,10 +5,22 @@ on: branches: - main - release/* + pull_request: + types: [closed] + branches: + - develop + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: generate: name: Generate and Deploy documentation + if: > + github.event_name == 'push' || + (github.event_name == 'pull_request' && + startsWith(github.head_ref, 'docs/')) runs-on: ubuntu-latest steps: - name: Git checkout @@ -73,7 +85,12 @@ jobs: # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 - if: startsWith(github.ref, 'refs/heads/main') + if: > + (startsWith(github.ref, 'refs/heads/main')) || + (github.event_name == 'pull_request' && + github.event.pull_request.merged == true && + github.event.pull_request.base.ref == 'develop' && + startsWith(github.head_ref, 'docs/')) with: github_token: ${{ secrets.DEPLOY_TOKEN }} publish_dir: ./website/build