Skip to content

Commit fe7f0a5

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

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ permissions:
1717

1818
concurrency:
1919
group: pages
20-
cancel-in-progress: false
20+
cancel-in-progress: true
2121

2222
jobs:
23-
publish-docs:
24-
environment:
25-
name: github-pages
26-
url: ${{ steps.deployment.outputs.page_url }}
27-
runs-on: windows-latest
23+
build-docs:
24+
if: ${{ github.ref == 'refs/heads/master' }}
25+
runs-on: ubuntu-latest
2826

2927
steps:
3028
- name: Checkout
@@ -54,6 +52,15 @@ jobs:
5452
with:
5553
path: 'docs/_site'
5654

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:
5764
- name: Deploy to GitHub Pages
5865
id: deployment
5966
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)