Skip to content

Commit 3843e56

Browse files
authored
ci: extend workflow to validate builds on PRs (#41)
Renames publish-docs to continuous-delivery and extends it to build documentation on all pull requests. This ensures that builds are validated before merging while maintaining the same deployment behavior for the main branch. The deploy job runs conditionally only when on the main branch, supporting both push events and manual workflow_dispatch. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 3ea1724 commit 3843e56

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# This workflow builds and deploys the Docusaurus documentation to GitHub Pages
2-
# when changes are pushed to the main branch.
3-
name: Deploy Docusaurus to GitHub Pages
1+
# This workflow builds the Docusaurus documentation on pull requests
2+
# and deploys it to GitHub Pages when changes are pushed to main.
3+
name: Continuous Delivery
44

55
on:
66
workflow_dispatch:
7+
pull_request:
78
push:
89
branches:
910
- main
@@ -19,7 +20,7 @@ concurrency:
1920
permissions: read-all
2021

2122
jobs:
22-
build:
23+
Build:
2324
runs-on: ubuntu-latest
2425
permissions:
2526
contents: read
@@ -38,6 +39,7 @@ jobs:
3839
cache-dependency-path: website/yarn.lock
3940

4041
- name: Setup Pages
42+
if: github.ref == 'refs/heads/main'
4143
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
4244

4345
- name: Install dependencies
@@ -49,18 +51,20 @@ jobs:
4951
run: yarn build
5052

5153
- name: Upload artifact
54+
if: github.ref == 'refs/heads/main'
5255
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
5356
with:
5457
path: website/build
5558

56-
deploy:
59+
Deploy:
60+
if: github.ref == 'refs/heads/main'
5761
permissions:
5862
pages: write
5963
id-token: write
6064
environment:
6165
name: github-pages
6266
url: ${{ steps.deployment.outputs.page_url }}
63-
needs: build
67+
needs: Build
6468
runs-on: ubuntu-latest
6569
steps:
6670
- name: Deploy to GitHub Pages

0 commit comments

Comments
 (0)