Skip to content

Commit 5283434

Browse files
committed
ci(ghPages): update GitHub Action for pages deployment so it doesnt cause error for branch protection
1 parent 8cfbd08 commit 5283434

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/build-deploy-docs.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ on:
88
- 'src/**'
99
- 'README.md'
1010
- '.github/workflows/build-deploy-docs.yml'
11-
pull_request:
12-
branches: [ master ]
13-
paths:
14-
- 'docs/**'
15-
- 'src/**'
16-
- 'README.md'
1711
workflow_dispatch:
1812

1913
permissions:
@@ -23,14 +17,12 @@ permissions:
2317

2418
concurrency:
2519
group: pages
26-
cancel-in-progress: false
20+
cancel-in-progress: true
2721

2822
jobs:
29-
publish-docs:
30-
environment:
31-
name: github-pages
32-
url: ${{ steps.deployment.outputs.page_url }}
33-
runs-on: windows-latest
23+
build-docs:
24+
if: ${{ github.ref == 'refs/heads/master' }}
25+
runs-on: ubuntu-latest
3426

3527
steps:
3628
- name: Checkout
@@ -60,6 +52,15 @@ jobs:
6052
with:
6153
path: 'docs/_site'
6254

55+
deploy-docs:
56+
needs: build-docs
57+
if: ${{ needs.build-docs.result == 'success' && github.ref == 'refs/heads/master' }}
58+
environment:
59+
name: github-pages
60+
url: ${{ steps.deployment.outputs.page_url }}
61+
runs-on: ubuntu-latest
62+
63+
steps:
6364
- name: Deploy to GitHub Pages
6465
id: deployment
6566
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)